only set dhcp_enable if lan proto is set to static
authorFelix Fietkau <nbd@openwrt.org>
Sun, 30 Jul 2006 03:18:50 +0000 (03:18 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 30 Jul 2006 03:18:50 +0000 (03:18 +0000)
SVN-Revision: 4324

openwrt/package/dnsmasq/files/dnsmasq.init

index 140f727f4683ff2789a23bac71ed595885e7785a..14fc698cff7e5fe3294b770c00cd22329916a4c4 100644 (file)
@@ -13,8 +13,9 @@ scan_interfaces
 args=""
 iface=lan
 config_get ifname "$iface" ifname
+config_get proto "$iface" proto
 
-dhcp_enable="${dhcp_enable:-1}"
+[ "$proto" = static ] && dhcp_enable="${dhcp_enable:-1}"
 dhcp_start="${dhcp_start:-100}"
 dhcp_num="${dhcp_num:-50}"
 dhcp_lease="${dhcp_lease:-12h}"
@@ -33,7 +34,7 @@ dhcp_lease="${dhcp_lease:-12h}"
                eval $(ipcalc $ipaddr $netmask ${dhcp_start:-100} ${dhcp_num:-150})
                
                # and pass the args via config parser defines
-               echo "@define dhcp_enable 1"
+               echo "${dhcp_enable:+@define dhcp_enable 1}"
                echo "@define netmask $NETMASK"
                echo "@define start $START"
                echo "@define end $END"