2020-09-15 05:56:43 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
cd /etc/letsencrypt/live/
|
|
|
|
email='{{EMAIL}}'
|
|
|
|
path='{{SSL_PATH}}'
|
|
|
|
|
2020-12-17 05:47:36 +00:00
|
|
|
command='certbot certonly --standalone'
|
2020-09-15 05:56:43 +00:00
|
|
|
|
|
|
|
for i in $(ls -d */ |awk -F"/" '{print $1}'); do
|
2020-12-17 05:47:36 +00:00
|
|
|
echo $i
|
|
|
|
command+=" -d "$i
|
2020-09-15 05:56:43 +00:00
|
|
|
done
|
|
|
|
|
2020-12-17 05:47:36 +00:00
|
|
|
command+=" --non-interactive --agree-tos --email $email --http-01-port=8888"
|
|
|
|
|
|
|
|
bash -c "$command"
|
2020-09-15 05:56:43 +00:00
|
|
|
|
|
|
|
for i in $(ls -d */ |awk -F"/" '{print $1}'); do
|
2021-01-06 15:05:23 +00:00
|
|
|
bash -c "cat /etc/letsencrypt/live/$i/fullchain.pem /etc/letsencrypt/live/$i/privkey.pem > $path/$i.pem"
|
2020-09-15 05:56:43 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Reload HAProxy
|
2021-01-10 04:48:18 +00:00
|
|
|
sudo systemctl reload haproxy
|