nginx-certbot/scripts/run_letsencrypt.sh

19 lines
691 B
Bash
Raw Normal View History

2015-11-22 19:17:01 +00:00
for d in $DOMAINS
do
echo "Running letsencrypt for $d"
letsencrypt --standalone --standalone-supported-challenges\
http-01 --agree-dev-preview --agree-tos --renew-by-default\
--server https://acme-v01.api.letsencrypt.org/directory\
--email $EMAIL -d $d certonly
ec=$?
echo "letsencrypt exit code $ec"
if [ $ec -eq 0 ]
then
# For haproxy, you need to concatenate the full chain with the private key
cat /etc/letsencrypt/live/$d/fullchain.pem /etc/letsencrypt/live/$d/privkey.pem > /certs/$d.pem
# For nginx or apache, you need both separate files
# cp /etc/letsencrypt/live/$d/fullchain.pem /certs/$d.pem
# cp /etc/letsencrypt/live/$d/privkey.pem /certs/$d.key
fi
done