Last active
March 4, 2016 20:38
-
-
Save stefanotorresi/1650c3e9708892c30fdb to your computer and use it in GitHub Desktop.
Let's Encrypt renewal cron job
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
#!/usr/bin/env bash | |
if ! /opt/letsencrypt/letsencrypt-auto renew > /var/log/letsencrypt/renew.log 2>&1 ; then | |
echo "Automated renewal failed:" | |
cat /var/log/letsencrypt/renew.log | |
exit 1 | |
fi | |
if [[ "$(tail -1 /var/log/letsencrypt/renew.log)" != 'No renewals were attempted.' ]]; then | |
service apache2 restart 1> /dev/null | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment