Skip to content

Instantly share code, notes, and snippets.

@kosso
Created March 21, 2017 21:54
Show Gist options
  • Save kosso/513b9f94c6a1f39c163d8d45ee0e3f21 to your computer and use it in GitHub Desktop.
Save kosso/513b9f94c6a1f39c163d8d45ee0e3f21 to your computer and use it in GitHub Desktop.
LetsEncrypt autorenewal
LetsEncrypt Autorenewal
-----------------------
Let's say you created and installed an Apache certificate with:
./certbot-auto -n --apache --agree-tos -m [email protected] -d yourdomain.com -d www.yourdomain.com
Create a file called 'letsencrypt-autorenew' (or anything really)
containing:
#! /usr/bin/env bash
cd /opt/letsencrypt
./certbot-auto renew --post-hook "service apache2 reload"
And copy that to /etc/cron.monthly/
This will check for expiry of all certificates and renew any expiring in the next 30 days then reload Apache.
Job done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment