diff --git a/README.md b/README.md index ba26196..62eea3e 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,19 @@ DSTROOTCAX3.txt - Root CA cert needed for use with the gen-unifi-cert.sh script apache-le-alias.conf - Use with apache for LE well-known alias config -apache-le-proxy.conf - Use with apache for LE well-known proxy config \ No newline at end of file +apache-le-proxy.conf - Use with apache for LE well-known proxy config + +How To Use +============================================================= + +gen-unifi-cert.sh + 1) Do initial cert generation: + + gen-unifi-cert.sh -e email@address.com -d unifi.somedomain.com -d unifi.someotherdomain.com + + 2) Put in /etc/cron.weekly/renew-unifi-ssl if everything works okay: + + /path/to/script/gen-unifi-cert.sh -r -d unifi.somedomain.com -d unifi.someotherdomain.com + + 3) Script will now run weekly and renew the certificate if necessary ( <30 days remain) + and restart unifi only if cert has been renewed. \ No newline at end of file diff --git a/gen-unifi-cert.sh b/gen-unifi-cert.sh index db476d6..cea01c0 100755 --- a/gen-unifi-cert.sh +++ b/gen-unifi-cert.sh @@ -71,8 +71,8 @@ else -deststorepass aircontrolenterprise echo "Inserting certificate into Unifi keystore..." keytool -trustcacerts -importkeystore \ - -deststorepass aircontrolenterprise \ - -destkeypass aircontrolenterprise \ + -deststorepass aircontrolenterprise \ + -destkeypass aircontrolenterprise \ -destkeystore /usr/lib/unifi/data/keystore \ -srckeystore ${TEMPFILE} -srcstoretype PKCS12 \ -srcstorepass aircontrolenterprise \