15 lines
467 B
Bash
15 lines
467 B
Bash
#!/usr/bin/env bash
|
|
|
|
CERTS=$(certbot certificates | grep 'Certificate Name'| cut -c 21-)
|
|
|
|
# Renew the certificate
|
|
certbot renew #--force-renewal --tls-sni-01-port=8888
|
|
|
|
# Concatenate new cert files, with less output (avoiding the use tee and its output to stdout)
|
|
for certs in $CERTS; do
|
|
bash -c "cat /etc/letsencrypt/live/$certs/fullchain.pem /etc/letsencrypt/live/$certs/privkey.pem > /etc/haproxy/ssl/$certs.pem"
|
|
done
|
|
|
|
# Reload HAProxy
|
|
systemctl reload haproxy
|