Created
January 6, 2020 08:03
-
-
Save ekarisky/258edaaf00f70d77f532be3a35ddaebe to your computer and use it in GitHub Desktop.
Renew Lets Encrypt SSL for IPSec
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
| #!/bin/bash | |
| letsencrypt renew -m [EMAIL] --agree-tos | |
| for file in /etc/ipsec.d/private/*; | |
| do | |
| CERTDOMAIN=`basename $file .pem`; | |
| diff -q /etc/ipsec.d/private/${CERTDOMAIN}.pem /etc/letsencrypt/live/${CERTDOMAIN}/privkey.pem || cp -L /etc/letsencrypt/live/${CERTDOMAIN}/privkey.pem /etc/ipsec.d/private/${CERTDOMAIN}.pem | |
| diff -q /etc/letsencrypt/live/${CERTDOMAIN}/cert.pem /etc/ipsec.d/certs/${CERTDOMAIN}.pem || cp -L /etc/letsencrypt/live/${CERTDOMAIN}/cert.pem /etc/ipsec.d/certs/${CERTDOMAIN}.pem | |
| done | |
| ipsec restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment