Created
November 18, 2020 20:01
-
-
Save mhou1981/6c8e1246110a60825f0fd8f845fa8137 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
# Put this shell script under /etc/letsencrypt/renewal-hooks/post to auto update plex SSL with Let's Encrypt. | |
HOSTNAME="$(hostname -f)" | |
openssl pkcs12 -export -out /var/lib/plexmediaserver/certificate.pfx -inkey /etc/letsencrypt/live/${HOSTNAME}/privkey.pem -in /etc/letsencrypt/live/${HOSTNAME}/cert.pem -certfile /etc/letsencrypt/live/${HOSTNAME}/chain.pem -passout pass: | |
chown plex:plex /var/lib/plexmediaserver/certificate.pfx | |
sleep 5 | |
systemctl restart plexmediaserver.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment