Created
April 6, 2018 04:24
-
-
Save qubbit/e782b248a58df18afdb1c8cc08269111 to your computer and use it in GitHub Desktop.
Automatic Let's Encrypt Renewal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
RENEWAL_STATUS=$(certbot-auto certonly \ | |
-d 'domain.com,sub.domain.com' \ | |
--nginx \ | |
-n \ | |
--expand | |
) | |
curl -s --user 'api:key-MAILGUN_API_KEY' \ | |
https://api.mailgun.net/v3/domain.com/messages \ | |
-F from='Snow White <[email protected]>' \ | |
-F [email protected] \ | |
-F subject='SSL Certificates Renewed!' \ | |
-F text="$RENEWAL_STATUS" | |
# mv renew_certs.sh /etc/cron.monthly | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment