aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-04-11 16:13:27 +0000
committerJo-Philipp Wich <jow@openwrt.org>2014-04-11 16:13:27 +0000
commita417886bdc57a74f279d7a1039c456c8515e0819 (patch)
tree6d79d65bdd0b5acb7da0f340d394434b6720e9f4 /package
parentd0c0b1f674c8b5b4fe37bb5489aaa7e3a1e3d93d (diff)
downloadmaster-187ad058-a417886bdc57a74f279d7a1039c456c8515e0819.tar.gz
master-187ad058-a417886bdc57a74f279d7a1039c456c8515e0819.tar.bz2
master-187ad058-a417886bdc57a74f279d7a1039c456c8515e0819.zip
uhttpd: do not attempt to configure Lua handler if referenced file does not exist
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40457 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-xpackage/network/services/uhttpd/files/uhttpd.init8
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 9a76d8c1ff..608aa9d36b 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"