Skip to content

Instantly share code, notes, and snippets.

@katopz
Created December 11, 2016 11:04
Show Gist options
  • Save katopz/28340c56898895ecdc44ffc2e2e04612 to your computer and use it in GitHub Desktop.
Save katopz/28340c56898895ecdc44ffc2e2e04612 to your computer and use it in GitHub Desktop.
reccers
#!/bin/sh
# https://github.com/certbot/certbot/issues/1833
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
# Ensure script is call
echo $(date)'|Renewal' >> /var/log/letsencrypt/daily.log
# This script renews all the Let's Encrypt certificates with a validity < 30 days
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
# Restart to take effect
nginx -t && nginx -s reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment