Skip to content

Instantly share code, notes, and snippets.

@fuyufjh
Created March 8, 2017 16:54
Show Gist options
  • Save fuyufjh/a4be3f4a9b3218fd15ebbb386e2da637 to your computer and use it in GitHub Desktop.
Save fuyufjh/a4be3f4a9b3218fd15ebbb386e2da637 to your computer and use it in GitHub Desktop.
Certbot Renew
#!/usr/bin/env bash
printf "\nattempt to renew certificates at " >>/var/log/certbot_cron.log 2>&1
date >>/var/log/certbot_cron.log 2>&1
certbot renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx" --standalone-supported-challenges http-01 >>/var/log/certbot_cron.log 2>&1
printf "renew finished\n" >>/var/log/certbot_cron.log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment