letsencrypt permissions when renewing

This commit is contained in:
Bob Mottram 2017-05-19 22:03:45 +01:00
parent 21ab3ceb5f
commit 185b872d3e
1 changed files with 5 additions and 0 deletions

View File

@ -232,9 +232,14 @@ function add_cert_letsencrypt {
# stop the web server
systemctl stop nginx
chgrp -R root /etc/letsencrypt
chmod -R 777 /etc/letsencrypt
certbot certonly -n --server $LETSENCRYPT_SERVER --standalone -d $LETSENCRYPT_HOSTNAME --renew-by-default --agree-tos --email $MY_EMAIL_ADDRESS
if [ ! "$?" = "0" ]; then
echo $"Failed to install letsencrypt for domain $LETSENCRYPT_HOSTNAME"
chgrp -R ssl-cert /etc/letsencrypt
chmod -R g=rX /etc/letsencrypt
systemctl start nginx
exit 63216
fi