1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
5 HTTPD_BIN
="/usr/sbin/httpd"
10 config_get hostname
"$cfg" hostname
15 local c_file port realm home args
17 config_get c_file
"$cfg" c_file
18 [ -n "$c_file" -a -f "$c_file" ] && append args
"-c \"$c_file\""
19 config_get port
"$cfg" port
20 append args
"-p ${port:-80}"
21 config_get home
"$cfg" home
23 [ -d "$home" ] ||
return 1
24 append args
"-h \"$home\""
25 config_get realm
"$cfg" realm
26 realm
="${realm:-$hostname}"
27 append args
"-r \"$realm\""
28 eval "$HTTPD_BIN $args"
32 [ -x "$HTTPD_BIN" ] ||
return 1
36 config_foreach system_config system
37 hostname
="${hostname:-OpenWrt}"
42 uci_set_default httpd
<<EOF
49 config_foreach httpd_config httpd