Browse Source

Disable site if certificate creation fails

Bob Mottram 7 years ago
parent
commit
3ba7b5db42
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/freedombone-utils-web

+ 4
- 0
src/freedombone-utils-web View File

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