diff --git a/certbot.sh b/certbot.sh index 729e2ed..175ff1b 100644 --- a/certbot.sh +++ b/certbot.sh @@ -5,15 +5,17 @@ case $1 in # Renew certificates, trust in certbot's algorithms renew) /usr/bin/certbot renew --quit --agree-tos ;; bootstrap) - test -d "/etc/letsencrypt/live/api.${SUTTY}" && exit 0 + for site in ${SUTTY} api.${SUTTY}; do + test -d "/etc/letsencrypt/live/${site}" && exit 0 - # Get the certificate for the domain, the webserver will need - # access to this directory - /usr/bin/certbot certonly --email "certbot@${SUTTY}" \ - --webroot \ - --agree-tos \ - --webroot-path /var/lib/letsencrypt \ - -d "api.${SUTTY}" ;; + # Get the certificate for the domain, the webserver will need + # access to this directory + /usr/bin/certbot certonly --email "certbot@${SUTTY}" \ + --webroot \ + --agree-tos \ + --webroot-path /var/lib/letsencrypt \ + -d "${site}" + done ;; # Generate certificates *) # Save headers here