mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update to latest Nginx version
This commit is contained in:
parent
ed43c60b5a
commit
6c716b8886
10 changed files with 349 additions and 36 deletions
26
nginx/files-luci-support/60_nginx-luci-support
Normal file
26
nginx/files-luci-support/60_nginx-luci-support
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/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
|
||||
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)
|
||||
sed -i "3s/.*/worker_processes "$core_number";/" /etc/nginx/nginx.conf
|
||||
if [ -n "$(pgrep uhttpd)" ]; then
|
||||
/etc/init.d/uhttpd stop
|
||||
/etc/init.d/uhttpd disable
|
||||
fi
|
||||
if [ -n "$(pgrep nginx)" ]; then
|
||||
/etc/init.d/nginx restart
|
||||
else
|
||||
/etc/init.d/nginx start
|
||||
fi
|
||||
if [ -n "$(pgrep uwsgi)" ]; then
|
||||
/etc/init.d/uwsgi restart
|
||||
else
|
||||
/etc/init.d/uwsgi start
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue