uhttpd: don't process ubus_* and lua_* options if corresponding plugin is not install...
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 15 Dec 2013 15:32:37 +0000 (15:32 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 15 Dec 2013 15:32:37 +0000 (15:32 +0000)
SVN-Revision: 39057

package/network/services/uhttpd/files/uhttpd.init

index 5b7686470b77cb64e50e0e26222003b52b2704e6..9a76d8c1ffeffda1069f7cc0cd59b0c0b2945083 100755 (executable)
@@ -67,10 +67,14 @@ start_instance()
        append_arg "$cfg" realm "-r" "${realm:-OpenWrt}"
        append_arg "$cfg" config "-c"
        append_arg "$cfg" cgi_prefix "-x"
-       append_arg "$cfg" lua_prefix "-l"
-       append_arg "$cfg" lua_handler "-L"
-       append_arg "$cfg" ubus_prefix "-u"
-       append_arg "$cfg" ubus_socket "-U"
+       [ -f /usr/lib/uhttpd_lua.so ] && {
+               append_arg "$cfg" lua_prefix "-l"
+               append_arg "$cfg" lua_handler "-L"
+       }
+       [ -f /usr/lib/uhttpd_ubus.so ] && {
+               append_arg "$cfg" ubus_prefix "-u"
+               append_arg "$cfg" ubus_socket "-U"
+       }
        append_arg "$cfg" script_timeout "-t"
        append_arg "$cfg" network_timeout "-T"
        append_arg "$cfg" http_keepalive "-k"