mirror of https://github.com/Aidaho12/haproxy-wi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
599 B
24 lines
599 B
4 years ago
|
#!/bin/bash
|
||
|
|
||
|
cd /etc/letsencrypt/live/
|
||
|
email='{{EMAIL}}'
|
||
|
path='{{SSL_PATH}}'
|
||
|
|
||
|
ps ax |grep 'certbot certonly --standalone' |grep -v grep |awk '{print $1}' |xargs kill
|
||
|
|
||
|
command='sudo certbot certonly --standalone'
|
||
|
|
||
|
for i in $(ls -d */ |awk -F"/" '{print $1}'); do
|
||
|
echo $i
|
||
|
command+=" -d "$i
|
||
|
done
|
||
|
|
||
|
command+=' --non-interactive --agree-tos --email $email --http-01-port=8888'
|
||
|
|
||
|
for i in $(ls -d */ |awk -F"/" '{print $1}'); do
|
||
|
bash -c "cat /etc/letsencrypt/live/$i/fullchain.pem /etc/letsencrypt/live/$i/privkey.pem > $path/$i.pem"
|
||
|
done
|
||
|
|
||
|
bash -c $command
|
||
|
# Reload HAProxy
|
||
|
sudo systemctl status haproxy
|