fix certbot-renew.sh syntax

This commit is contained in:
bunkerity 2020-03-28 23:31:30 +01:00
parent 834afa1327
commit c56bde4f0c
1 changed files with 2 additions and 2 deletions

View File

@ -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