This commit is contained in:
f 2019-10-01 15:28:14 -03:00
parent 5d3d7ce80e
commit dc5856cb03
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D

View file

@ -36,16 +36,19 @@ case $1 in
domain="$(echo "${name}" | sed "s/[^\.]$/&.${SUTTY}/")" domain="$(echo "${name}" | sed "s/[^\.]$/&.${SUTTY}/")"
domain="${domain%.}" domain="${domain%.}"
# Skip already existing domains # Generate a certificate for www also
test -d "/etc/letsencrypt/live/${domain}" && continue for d in ${domain} www.${domain}; do
# Skip already existing domains
test -d "/etc/letsencrypt/live/${d}" && continue
# Get the certificate for the domain, the webserver will need # Get the certificate for the domain, the webserver will need
# access to this directory # access to this directory
/usr/bin/certbot certonly --email "certbot@${SUTTY}" \ /usr/bin/certbot certonly --email "certbot@${SUTTY}" \
--webroot \ --webroot \
--agree-tos \ --agree-tos \
--webroot-path /var/lib/letsencrypt \ --webroot-path /var/lib/letsencrypt \
-d "${domain}" -d "${d}"
done
done done
# Fix permissions, users in group ssl have read access # Fix permissions, users in group ssl have read access