Browse Source

typo in the concatenate line, sorry

master
LecygneNoir 7 years ago
parent
commit
d77924a75c
1 changed files with 8 additions and 8 deletions
  1. +8
    -8
      renew-certificates

+ 8
- 8
renew-certificates View File

@ -5,19 +5,19 @@ certbot_bin="/root/letsencrypt/certbot-auto"
haproxy_pem_path="/etc/haproxy/cert"
#Renew all certificates that needed it
#${certbot_bin} renew
#if [ $? -eq 0 ]; then
# echo "Certificates renewed ! Now creating .pem"
#else
# echo "$(date +%c) Error renewing certificates with error code $?, exit script..."
# exit 1
#fi
${certbot_bin} renew
if [ $? -eq 0 ]; then
echo "Certificates renewed ! Now creating .pem"
else
echo "$(date +%c) Error renewing certificates with error code $?, exit script..."
exit 1
fi
#Then, create domain.pem containing fullchain et privkey for haproxy
for domainconf in $(ls /etc/letsencrypt/renewal/); do
domain=${domainconf%.conf}
echo "create ${domain}.pem"
cat /etc/letsencrypt/live/${domain]/fullchain.pem /etc/letsencrypt/live/${domain}/privkey.pem > ${haproxy_pem_path}/${domain}.pem
cat /etc/letsencrypt/live/${domain}/fullchain.pem /etc/letsencrypt/live/${domain}/privkey.pem > ${haproxy_pem_path}/${domain}.pem
done
# At the end, reload haproxy

Loading…
Cancel
Save