sync
This commit is contained in:
40
consul_backup/scripts/letsconsul_auto
Normal file
40
consul_backup/scripts/letsconsul_auto
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
set -x
|
||||
|
||||
IFS=";"
|
||||
|
||||
apk add curl
|
||||
for group in $LETSCONSUL_DOMAINS
|
||||
do
|
||||
echo
|
||||
echo "-----------------------"
|
||||
IFS=" "
|
||||
domains=""
|
||||
domain_main=""
|
||||
for domain in $group
|
||||
do
|
||||
if [ "$domain_main" = "" ]
|
||||
then
|
||||
domain_main="$domain"
|
||||
fi
|
||||
domains="$domains -d $domain"
|
||||
done
|
||||
|
||||
echo certbot certonly \
|
||||
-vvv \
|
||||
--test-cert \
|
||||
--preferred-challenges dns \
|
||||
--authenticator dns-duckdns \
|
||||
--dns-duckdns-token e4b5ca33-1f4d-494b-b06d-6dd4600df662 \
|
||||
--dns-duckdns-propagation-seconds 120 \
|
||||
--non-interactive \
|
||||
--agree-tos \
|
||||
--renew-by-default \
|
||||
$domains --email "stuart.stent@gmail.com"
|
||||
|
||||
echo curl -XPUT --data-bin "@/etc/letsencrypt/live/\*.${domain_main}/privkey.pem" http://$LETSCONSUL_CONSUL_URL:8500/v1/kv/letsconsul/$domain_main/privkey
|
||||
echo curl -XPUT --data-bin "@/etc/letsencrypt/live/\*.${domain_main}/fullchain.pem" http://$LETSCONSUL_CONSUL_URL:8500/v1/kv/letsconsul/$domain_main/fullchain
|
||||
done
|
||||
|
||||
echo curl -XPUT --data-bin @/var/log/letsencrypt/letsencrypt.log http://$LETSCONSUL_CONSUL_URL:8500/v1/kv/letsconsul/letsencrypt.log
|
||||
Reference in New Issue
Block a user