Skip to content

Instantly share code, notes, and snippets.

@amekusa
Last active July 11, 2017 14:18
Show Gist options
  • Select an option

  • Save amekusa/2ac6a3e7f4a93649a53fb28940935e7d to your computer and use it in GitHub Desktop.

Select an option

Save amekusa/2ac6a3e7f4a93649a53fb28940935e7d to your computer and use it in GitHub Desktop.
Let's Encrypt Auto Renewal
[Unit]
Description=Let's Encrypt renewal
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --pre-hook "/usr/bin/systemctl stop nginx.service" --post-hook "/usr/bin/systemctl start nginx.service" --quiet --agree-tos
ExecStartPost=/bin/systemctl reload nginx.service
[Unit]
Description=Daily renewal of Let's Encrypt's certificates
[Timer]
OnCalendar=daily
RandomizedDelaySec=1day
Persistent=true
[Install]
WantedBy=timers.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment