uhttpd: do not attempt to configure Lua handler if referenced file does not exist

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 40457
master
Jo-Philipp Wich 11 years ago
parent 92ab194d63
commit e0a3e3d1b6
  1. 8
      package/network/services/uhttpd/files/uhttpd.init

@ -57,7 +57,7 @@ start_instance()
local cfg="$1" local cfg="$1"
local realm="$(uci_get system.@system[0].hostname)" local realm="$(uci_get system.@system[0].hostname)"
local listen http https interpreter indexes path local listen http https interpreter indexes path handler
procd_open_instance procd_open_instance
procd_set_param respawn procd_set_param respawn
@ -68,8 +68,10 @@ start_instance()
append_arg "$cfg" config "-c" append_arg "$cfg" config "-c"
append_arg "$cfg" cgi_prefix "-x" append_arg "$cfg" cgi_prefix "-x"
[ -f /usr/lib/uhttpd_lua.so ] && { [ -f /usr/lib/uhttpd_lua.so ] && {
append_arg "$cfg" lua_prefix "-l" config_get handler "$cfg" lua_handler
append_arg "$cfg" lua_handler "-L" [ -f "$handler" ] && append_arg "$cfg" lua_prefix "-l" && {
procd_append_param command "-L" "$handler"
}
} }
[ -f /usr/lib/uhttpd_ubus.so ] && { [ -f /usr/lib/uhttpd_ubus.so ] && {
append_arg "$cfg" ubus_prefix "-u" append_arg "$cfg" ubus_prefix "-u"

Loading…
Cancel
Save