Disable site if certificate creation fails

This commit is contained in:
Bob Mottram 2018-02-18 12:35:01 +00:00
parent 6d144044cf
commit 3ba7b5db42
1 changed files with 4 additions and 0 deletions

View File

@ -254,6 +254,10 @@ function create_letsencrypt_cert {
check_certificates ${SITE_DOMAIN_NAME} check_certificates ${SITE_DOMAIN_NAME}
else else
echo $"Lets Encrypt failed for $SITE_DOMAIN_NAME" echo $"Lets Encrypt failed for $SITE_DOMAIN_NAME"
if [ -f /etc/nginx/sites-available/$SITE_DOMAIN_NAME ]; then
nginx_dissite $SITE_DOMAIN_NAME
systemctl restart nginx
fi
exit 682529 exit 682529
fi fi
return return