config_get leasefile $cfg leasefile
[ -e "$leasefile" ] || touch "$leasefile"
+ config_get_bool cachelocal "$cfg" cachelocal 1
}
dhcp_subscrid_add() {
[ -n "$ifname" ] || return 0
config_get dnsserver "$net" dns
- [ -n "$dnsserver" ] && {
+ [ "$cachelocal" = "0" -a -n "$dnsserver" ] && {
DNS_SERVERS="$DNS_SERVERS $dnsserver"
}
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
}
}
stop() {
+ [ -f /tmp/resolv.conf ] && {
+ rm -f /tmp/resolv.conf
+ ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
+ }
killall dnsmasq
+ return 0
}