Advertisement
Guest User

script to update ssl certificate in unifi

a guest
Jan 17th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. if test $(${FIND} /etc/letsencrypt/live/unifi.example.com/cert.pem -mmin -60)
  2. then
  3. ${SYSTEMCTL} stop unifi.service
  4. ${OPENSSL} \
  5. pkcs12 \
  6. -export \
  7. -inkey /etc/letsencrypt/live/unifi.example.com/privkey.pem \
  8. -in /etc/letsencrypt/live/unifi.example.com/fullchain.pem \
  9. -out /tmp/unifi.example.com.p12 \
  10. -name ubnt \
  11. -password pass:temppass
  12. ${KEYTOOL} \
  13. -importkeystore \
  14. -deststorepass aircontrolenterprise \
  15. -destkeypass aircontrolenterprise \
  16. -destkeystore /opt/UniFi/data/keystore \
  17. -srckeystore /tmp/unifi.example.com.p12 \
  18. -srcstoretype PKCS12 \
  19. -srcstorepass temppass \
  20. -alias ubnt \
  21. -noprompt
  22. ${RM} -f /tmp/unifi.example.com.p12
  23. ${SYSTEMCTL} start unifi.service
  24. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement