diff --git a/certbotd.sh b/certbotd.sh index 50ecaf7..4105f95 100755 --- a/certbotd.sh +++ b/certbotd.sh @@ -46,22 +46,18 @@ case $1 in touch "${updated}" ;; bootstrap) - for site in ${SUTTY} api.${SUTTY}; do - test -d "/etc/letsencrypt/live/${site}" && exit 0 + test -d "/etc/letsencrypt/live/${SUTTY}" && 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 "${site}" + # Get a single certificate for the whole domain + /usr/bin/certbot \ + -a dns-njalla \ + --dns-njalla-credentials /etc/letsencrypt/njalla.ini \ + --email "certbot@${SUTTY}" \ + --agree-tos \ + -d "${SUTTY}" \ + -d "*.${SUTTY}" - cd /etc/letsencrypt/live - ln -s ${SUTTY} default - - touch "${updated}" - done + touch "${updated}" ;; prune)