+HTTPD_BIN="/usr/sbin/httpd"
+
+system_config() {
+ local cfg="$1"
+
+ config_get hostname "$cfg" hostname
+}
+
+httpd_config() {
+ local cfg="$1"
+ local c_file port realm home
+
+ config_get c_file "$cfg" c_file
+ [ -n "$c_file" -a -f "$c_file" ] && append args "-c \"$c_file\""
+ config_get port "$cfg" port
+ append args "-p ${port:-80}"
+ config_get home "$cfg" home
+ home="${home:-/www}"
+ [ -d "$home" ] || return 1
+ append args "-h \"$home\""
+ config_get realm "$cfg" realm
+ realm="${realm:-$hostname}"
+ append args "-r \"$realm\""
+ eval "$HTTPD_BIN $args"
+}