3 if nginx
-V 2>&1 |
grep -q ubus
&& [ -f /usr
/lib
/nginx
/modules
/ngx_http_ubus_module.so
]; then
4 if [ -z "$(cat /etc/nginx/conf.d/luci.locations | grep ubus)" ]; then
5 cat <<EOT >> /etc/nginx/conf.d/luci.locations
9 ubus_socket_path /var/run/ubus/ubus.sock;
15 if [ ! -f "/etc/nginx/module.d/ngx_http_ubus.module" ]; then
16 cat <<EOT > /etc/nginx/module.d/ngx_http_ubus.module
17 load_module /usr/lib/nginx/modules/ngx_http_ubus_module.so;
22 grep -q /var
/run
/ubus.sock
/etc
/nginx
/conf.d
/luci.locations
&&
23 sed -i 's#/var/run/ubus.sock#/var/run/ubus/ubus.sock#' /etc
/nginx
/conf.d
/luci.locations
25 if [ -x /etc
/init.d
/uhttpd
]; then
26 /etc
/init.d
/uhttpd disable
27 if [ -n "$(pgrep uhttpd)" ]; then
28 /etc
/init.d
/uhttpd stop
32 /etc
/init.d
/nginx
enable
33 if [ -n "$(pgrep nginx)" ]; then
34 /etc
/init.d
/nginx restart
36 /etc
/init.d
/nginx start
39 /etc
/init.d
/uwsgi
enable
40 if [ -n "$(pgrep uwsgi)" ]; then
41 /etc
/init.d
/uwsgi restart
43 /etc
/init.d
/uwsgi start