include the network state in the dnsmasq init script. this makes it possible to run...
[openwrt/svn-archive/archive.git] / package / dnsmasq / files / dnsmasq.init
index 52973d4ca051807200d62433c4ba538afbdb8ced..14c77fb013217f541762c43b0fc602a7490da2c5 100644 (file)
@@ -40,23 +40,25 @@ dhcp_add() {
        # check for an already active dhcp server on the interface, unless 'force' is set
        config_get_bool force "$cfg" force 0
        [ "$force" -gt 0 ] || {
-               udhcpc -n -q -R -s /bin/true -i $ifname >&- && return 0
+               udhcpc -n -q -R -s /bin/true -t 1 -i $ifname >&- && return 0
        }
        
        config_get start "$cfg" start
        config_get end "$cfg" end
        config_get leasetime "$cfg" leasetime
+       config_get options "$cfg" options
 
        leasetime="${leasetime:-12h}"
        start="$(dhcp_calc "${start:-100}")"
        end="$((${end:-150} + 1))"
        eval "$(ipcalc.sh $ipaddr $netmask $start $end)"
-       append args "-F $START,$END,$NETMASK,$leasetime"        
+       append args "-F $START,$END,$NETMASK,$leasetime${options:+ $options}"
 }
 
 start() {
        include /lib/network
        scan_interfaces
+       config_load /var/state/network
        config_load dhcp
 
        args=""