diff --git a/scripts/certbot-renew.sh b/scripts/certbot-renew.sh index 171bebe..643e0be 100644 --- a/scripts/certbot-renew.sh +++ b/scripts/certbot-renew.sh @@ -9,7 +9,7 @@ function replace_in_file() { # check if HTTP to HTTPS is enabled # then disable it temporarily -if [ grep -q "include /etc/nginx/redirect-http-to-https.conf;" "/etc/nginx/nginx.conf" ] ; then +if grep -q "include /etc/nginx/redirect-http-to-https.conf;" "/etc/nginx/nginx.conf" ; then replace_in_file "/etc/nginx/nginx.conf" "include /etc/nginx/redirect-http-to-https.conf;" "#include /etc/nginx/redirect-http-to-https.conf;" if [ -f /run/nginx/nginx.pid ] ; then /usr/sbin/nginx -s reload @@ -20,7 +20,7 @@ fi certbot renew # enable HTTP to HTTPS if needed -if [ grep -q "#include /etc/nginx/redirect-http-to-https.conf;" "/etc/nginx/nginx.conf" ] ; then +if grep -q "#include /etc/nginx/redirect-http-to-https.conf;" "/etc/nginx/nginx.conf" ; then replace_in_file "/etc/nginx/nginx.conf" "#include /etc/nginx/redirect-http-to-https.conf;" "include /etc/nginx/redirect-http-to-https.conf;" fi