Ucified PXE-Boot options for dnsmasq
[openwrt/openwrt.git] / package / dnsmasq / files / dnsmasq.init
index 8643349573d1064756e886a7e64d922a461af263..7d32be077efcfbc1b0bb895becd5c8ab5e56eacd 100644 (file)
@@ -52,6 +52,7 @@ dnsmasq() {
        append_bool "$cfg" dbus "-1"
        append_bool "$cfg" boguspriv "-b"
        append_bool "$cfg" expandhosts "-E"
+       append_bool "$cfg" enable_tftp "--enable-tftp"
 
        append_parm "$cfg" dnsforwardmax "-0"
        append_parm "$cfg" port "-p"
@@ -63,6 +64,8 @@ dnsmasq() {
        append_parm "$cfg" "local" "-S"
        append_parm "$cfg" "leasefile" "-l"
        append_parm "$cfg" "resolvfile" "-r"
+       append_parm "$cfg" "tftp_root" "--tftp-root"
+       append_parm "$cfg" "dhcp_boot" "--dhcp-boot"
 
        config_get leasefile $cfg leasefile
        [ -e "$leasefile" ] || touch "$leasefile"
@@ -242,13 +245,9 @@ dhcp_option_add() {
        local cfg="$1"
        local name="$2"
 
-       for count in $(seq 0 100); do
-               eval current_value=\$CONFIG_"$cfg"_dhcp"$count"
-               if [ -z "$current_value" ]; then
-                       let "count-=1"
-                       break
-               fi
-               append args "-O $name","$current_value"
+       config_get dhcp_option "$cfg" dhcp_option
+       for o in $dhcp_option; do
+               append args "-O $name","$o"
        done
 
 }