diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2014-04-11 16:13:27 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2014-04-11 16:13:27 +0000 |
commit | e0a3e3d1b64001030bccdba9b7d8e822616435e8 (patch) | |
tree | 7ed6dacc90d511a2e866838f2b42d17619567369 /package/network/services/uhttpd | |
parent | 92ab194d63c8384491632db6e4dfcda069013794 (diff) | |
download | mtk-20170518-e0a3e3d1b64001030bccdba9b7d8e822616435e8.zip mtk-20170518-e0a3e3d1b64001030bccdba9b7d8e822616435e8.tar.gz mtk-20170518-e0a3e3d1b64001030bccdba9b7d8e822616435e8.tar.bz2 |
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
Diffstat (limited to 'package/network/services/uhttpd')
-rwxr-xr-x | package/network/services/uhttpd/files/uhttpd.init | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 9a76d8c..608aa9d 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -57,7 +57,7 @@ start_instance() local cfg="$1" 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_set_param respawn @@ -68,8 +68,10 @@ start_instance() append_arg "$cfg" config "-c" append_arg "$cfg" cgi_prefix "-x" [ -f /usr/lib/uhttpd_lua.so ] && { - append_arg "$cfg" lua_prefix "-l" - append_arg "$cfg" lua_handler "-L" + config_get handler "$cfg" lua_handler + [ -f "$handler" ] && append_arg "$cfg" lua_prefix "-l" && { + procd_append_param command "-L" "$handler" + } } [ -f /usr/lib/uhttpd_ubus.so ] && { append_arg "$cfg" ubus_prefix "-u" |