X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=blobdiff_plain;f=package%2Fdnsmasq%2Ffiles%2Fdnsmasq.init;h=de9b92d52bc73e9e8b8dea3e8673d0a1512c47df;hp=79e57d5f3cee63590fe4606e0e5d1f3cea2c61b8;hb=1b1593db4c6239a0f90e85ca76a86df340573684;hpb=52623a6f7fac42267b5591b224d69ff7584a2580 diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init index 79e57d5f3c..de9b92d52b 100644 --- a/package/dnsmasq/files/dnsmasq.init +++ b/package/dnsmasq/files/dnsmasq.init @@ -36,6 +36,10 @@ append_parm() { append args "$switch $_loctmp" } +append_server() { + append args "-S $1" +} + dnsmasq() { local cfg="$1" append_bool "$cfg" authoritative "-K" @@ -52,6 +56,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" @@ -61,8 +66,11 @@ dnsmasq() { append_parm "$cfg" "queryport" "-Q" append_parm "$cfg" "domain" "-s" append_parm "$cfg" "local" "-S" + config_list_foreach "$cfg" "server" append_server 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 +250,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 } @@ -280,5 +284,10 @@ start() { } stop() { + [ -f /tmp/resolv.conf ] && { + rm -f /tmp/resolv.conf + ln -s /tmp/resolv.conf.auto /tmp/resolv.conf + } killall dnsmasq + return 0 }