Skip to content

Instantly share code, notes, and snippets.

@danrossi
Created April 23, 2016 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danrossi/ee15e1ba84ba8b203bb18fba5cb876fb to your computer and use it in GitHub Desktop.
Save danrossi/ee15e1ba84ba8b203bb18fba5cb876fb to your computer and use it in GitHub Desktop.
Lets Encrypt Renew Script For Nginx
#!/bin/sh
service nginx stop # or whatever your webserver is
letsencrypt renew -nvv --standalone > /var/log/letsencrypt/renew.log 2>&1
LE_STATUS=$?
service nginx start # or whatever your webserver is
if [ "$LE_STATUS" != 0 ]; then
echo Automated renewal failed:
cat /var/log/letsencrypt/renew.log
exit 1
fi
@danrossi
Copy link
Author

Schedule like

0 0 1 * * /path/scripts/renew.sh > /dev/null 2>&1
0 0 1 */4 * /path/scripts/renew_cloudfront_cert.sh 2>&1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment