Changeset 5896

Show
Ignore:
Timestamp:
03/21/10 03:35:28 (3 years ago)
Author:
jow
Message:

uhttpd: complete init script and sample configuration

Location:
luci/trunk/contrib/package/uhttpd/files
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/contrib/package/uhttpd/files/uhttpd.config

    r5876 r5896  
    1111    # CGI url prefix, will be searched in docroot. 
    1212    # Default is /cgi-bin 
    13     option cgi_prefix       /cgi-bin 
     13    option cgi_prefix   /cgi-bin 
    1414 
    1515    # Lua url prefix and handler script. 
     
    2626#   list listen_https   [::]:443 
    2727 
     28    # Basic auth realm, defaults to local hostname 
     29#   option realm    OpenWrt 
     30 
     31    # Configuration file in busybox httpd format 
     32#   option config   /etc/httpd.conf 
  • luci/trunk/contrib/package/uhttpd/files/uhttpd.init

    r5876 r5896  
    1919    local var="$2" 
    2020    local opt="$3" 
     21    local def="$4" 
    2122    local val 
    2223 
    2324    config_get val "$cfg" "$var" 
    24     [ -n "$val" ] && append UHTTPD_ARGS "$opt $val" 
     25    [ -n "$val" -o -n "$def" ] && append UHTTPD_ARGS "$opt ${val:-$def}" 
    2526} 
    2627 
     
    3031 
    3132    local cfg="$1" 
     33    local realm="$(uci get system.@system[0].hostname 2>/dev/null)" 
    3234    local ssl 
    3335 
    3436    append_arg "$cfg" home "-h" 
    35     append_arg "$cfg" cgi_prefix "-c" 
     37    append_arg "$cfg" realm "-r" "${realm:-OpenWrt}" 
     38    append_arg "$cfg" config "-c" 
     39    append_arg "$cfg" cgi_prefix "-x" 
    3640    append_arg "$cfg" lua_prefix "-l" 
    3741    append_arg "$cfg" lua_handler "-L"