diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-21 02:35:28 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-03-21 02:35:28 +0000 |
commit | 23052d8f013188302dd9faee47f6911e4ed0e1e1 (patch) | |
tree | 2c9170d9293039fa160e007b64fbc8b7e83493d7 /contrib/package/uhttpd/files/uhttpd.init | |
parent | 79dde1ad3fd240ec084b4b9c160c95e6c82336ee (diff) |
uhttpd: complete init script and sample configuration
Diffstat (limited to 'contrib/package/uhttpd/files/uhttpd.init')
-rwxr-xr-x | contrib/package/uhttpd/files/uhttpd.init | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/package/uhttpd/files/uhttpd.init b/contrib/package/uhttpd/files/uhttpd.init index 08c6a3929..b13cd60f3 100755 --- a/contrib/package/uhttpd/files/uhttpd.init +++ b/contrib/package/uhttpd/files/uhttpd.init @@ -18,10 +18,11 @@ append_arg() { local cfg="$1" local var="$2" local opt="$3" + local def="$4" local val config_get val "$cfg" "$var" - [ -n "$val" ] && append UHTTPD_ARGS "$opt $val" + [ -n "$val" -o -n "$def" ] && append UHTTPD_ARGS "$opt ${val:-$def}" } start_instance() @@ -29,10 +30,13 @@ start_instance() UHTTPD_ARGS="" local cfg="$1" + local realm="$(uci get system.@system[0].hostname 2>/dev/null)" local ssl append_arg "$cfg" home "-h" - append_arg "$cfg" cgi_prefix "-c" + 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" |