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>
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/
#!/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)
else
/etc/init.d/uwsgi start
fi
+ else
+ rm /etc/nginx/luci_nginx.conf
fi
fi
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
else
/etc/init.d/nginx start
fi
+ else
+ rm /etc/nginx/luci_nginx_ssl.conf
fi
fi