Created
November 7, 2017 14:58
-
-
Save askz/334acc6736eafc78473eed3c7d1bffc0 to your computer and use it in GitHub Desktop.
Renew Let's Encrypt certificates and put them in HAProxy ssl folder
This file contains 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 | |
# Let's encrypt: renew certificates and put them in haproxy ssl folder for reloading. | |
# Maxime Saddok <[email protected]> | |
# put in /etc/cron.weekly/le-renew && chmod +x /etc/cron.weekly/le-renew | |
set -x | |
set -e | |
/opt/letsencrypt/letsencrypt-auto --standalone --standalone-supported-challenges http-01 --http-01-port 9999 renew; | |
LE_OUTPUT=/etc/letsencrypt/live; | |
for i in ls /etc/letsencrypt/live/*; do | |
domain=`basename $i`; | |
cat $LE_OUTPUT/$domain/{fullchain.pem,privkey.pem} > /etc/haproxy/ssl/${domain}.pem; | |
done | |
systemctl reload haproxy; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment