Skip to content

Instantly share code, notes, and snippets.

@qianduan
Last active May 12, 2016 08:15
Show Gist options
  • Save qianduan/fe210cc9bd1561db0b9a4bc469f034fe to your computer and use it in GitHub Desktop.
Save qianduan/fe210cc9bd1561db0b9a4bc469f034fe to your computer and use it in GitHub Desktop.
auto renew let's encrypt certificate
#!/bin/sh
service nginx stop # or whatever your webserver is
/home/soft/letsencrypt.client/letsencrypt-auto 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment