You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
741 B

  1. #!/bin/sh
  2. if nginx -V 2>&1 | grep -q ubus; then
  3. if [ -z "$(cat /etc/nginx/conf.d/luci.locations | grep ubus)" ]; then
  4. cat <<EOT >> /etc/nginx/conf.d/luci.locations
  5. location /ubus {
  6. ubus_interpreter;
  7. ubus_socket_path /var/run/ubus.sock;
  8. ubus_parallel_req 2;
  9. }
  10. EOT
  11. fi
  12. fi
  13. if [ -x /etc/init.d/uhttpd ]; then
  14. /etc/init.d/uhttpd disable
  15. if [ -n "$(pgrep uhttpd)" ]; then
  16. /etc/init.d/uhttpd stop
  17. fi
  18. fi
  19. /etc/init.d/nginx enable
  20. if [ -n "$(pgrep nginx)" ]; then
  21. /etc/init.d/nginx restart
  22. else
  23. /etc/init.d/nginx start
  24. fi
  25. /etc/init.d/uwsgi enable
  26. if [ -n "$(pgrep uwsgi)" ]; then
  27. /etc/init.d/uwsgi restart
  28. else
  29. /etc/init.d/uwsgi start
  30. fi
  31. exit 0