nginx: fix bug in uci-defaults scripts 6466/head
authorAnsuel Smith <ansuelsmth@gmail.com>
Fri, 13 Jul 2018 16:14:21 +0000 (18:14 +0200)
committerAnsuel Smith <ansuelsmth@gmail.com>
Sat, 14 Jul 2018 21:40:26 +0000 (23:40 +0200)
Currently the uci-defaults scripts reset nginx config even it they are valid due to a bug in the if condition.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
net/nginx/Makefile
net/nginx/files-luci-support/60_nginx-luci-support
net/nginx/files-luci-support/70_nginx-luci-support-ssl

index be2a857a91d7548778f6b70978819ea7af96569e..86588b240534727e995cf16c378b57001fb4f080 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=nginx
 PKG_VERSION:=1.15.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=nginx-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://nginx.org/download/
index 38a8aa8855ef2172ab77bd9e3768c9fcfba76eed..dd076d2602ca230d0ee5454a069e1b6353734449 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 if [ -f "/etc/nginx/luci_nginx.conf" ] && [ -f "/etc/nginx/nginx.conf" ]; then
-       if [ ! "$(cat '/etc/nginx/nginx.conf' | grep -q 'luci_uwsgi.conf')" ]; then
+       if [ ! "$(cat '/etc/nginx/nginx.conf' | grep 'luci_uwsgi.conf')" ]; then
                mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf_old
                mv /etc/nginx/luci_nginx.conf /etc/nginx/nginx.conf
                core_number=$(grep -c ^processor /proc/cpuinfo)
@@ -20,6 +20,8 @@ if [ -f "/etc/nginx/luci_nginx.conf" ] && [ -f "/etc/nginx/nginx.conf" ]; then
                else
                        /etc/init.d/uwsgi start
                fi
+       else
+               rm /etc/nginx/luci_nginx.conf
        fi
 fi
 
index 1cc1a85fc9186a9561de3ca2e2caa4407cb7ec80..76ce3a81956059c52f5aadc2bf3a5b5f676a0567 100644 (file)
@@ -2,7 +2,7 @@
 
 
 if [ -f "/etc/nginx/luci_nginx_ssl.conf" ] && [ -f "/etc/nginx/nginx.conf" ]; then
-       if [ ! "$(cat '/etc/nginx/nginx.conf' | grep -q 'return 301 https://$host$request_uri;')" ]; then
+       if [ ! "$(cat '/etc/nginx/nginx.conf' | grep 'return 301 https://$host$request_uri;')" ]; then
                if [ -f "/etc/nginx/nginx.conf_old" ]; then
                        rm /etc/nginx/nginx.conf
                else
@@ -16,6 +16,8 @@ if [ -f "/etc/nginx/luci_nginx_ssl.conf" ] && [ -f "/etc/nginx/nginx.conf" ]; th
                else
                        /etc/init.d/nginx start
                fi
+       else
+               rm /etc/nginx/luci_nginx_ssl.conf
        fi
 fi