Created
October 11, 2020 14:21
-
-
Save Nepherte/4a4bbd90fc44431c838a904f19ada3f7 to your computer and use it in GitHub Desktop.
Script to import an SSL certificate into a UniFi USG.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Graceful shutdown of the http server. | |
kill -SIGINT $(cat /var/run/lighttpd.pid) | |
# Install certificate in the http server. | |
mv /home/admin/.certificate/server.pem /etc/lighttpd/server.pem | |
chown root:root /etc/lighttpd/server.pem; chmod 0400 /etc/lighttpd/server.pem | |
# Start http server with new certificate. | |
/usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment