Skip to content

Instantly share code, notes, and snippets.

@libook
Created July 23, 2017 17:05
Show Gist options
  • Save libook/58257bf747af55dfd2563f49eb141a29 to your computer and use it in GitHub Desktop.
Save libook/58257bf747af55dfd2563f49eb141a29 to your computer and use it in GitHub Desktop.
Systemd service for Let's Encrypt.
[Unit]
Description=Renews letsencrypt certificates
After=network.target
[Service]
Type=oneshot
WorkingDirectory=/etc/letsencrypt
ExecStart=/usr/bin/certbot renew --quiet --agree-tos --pre-hook "systemctl stop nginx.service" --post-hook "systemctl restart nginx.service"
[Unit]
Description=letsencrypt timer
[Timer]
OnCalendar=daily
Persistent=true
Unit=letsencrypt.service
[Install]
WantedBy=basic.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment