Created
July 6, 2017 17:14
-
-
Save fliiiix/69e64a28948a9f51f300ab7d893b753c 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/sh | |
cert_location="/usr/local/etc/letsencrypt.sh/certs/l33t.name/" | |
deploy_location="/usr/local/etc/nginx/ssl/" | |
su -m _letsencrypt -c 'zsh /usr/local/bin/letsencrypt.sh --cron' | |
cp -L "${cert_location}privkey.pem" "${deploy_location}privkey.pem" | |
cp -L "${cert_location}fullchain.pem" "${deploy_location}chain.pem" | |
chmod -R 644 "${deploy_location}" | |
service nginx restart | |
prosody_cert="/usr/jails/xmpp.l33t.name/usr/local/etc/prosody/certs/" | |
cp -L "${cert_location}privkey.pem" "${prosody_cert}privkey.pem" | |
cp -L "${cert_location}fullchain.pem" "${prosody_cert}cert.pem" | |
chmod -R 640 ${prosody_cert} | |
chmod 750 ${prosody_cert} | |
chown -R 242:242 ${prosody_cert} | |
jexec xmpp_l33t_name service prosody restart | |
su -m _letsencrypt -c 'zsh /usr/local/bin/letsencrypt.sh --cleanup' | |
echo "ssl renew $(date)" > /tmp/ssl.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment