- # ignore requests from wan interface
- config_get wan_proto wan proto
- config_get wan_ifname wan ifname
- [ -z "$wan_proto" -o "$wan_proto" = "none" ] || echo "@define wan_ifname $wan_ifname"
+ 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${options:+ $options}"
+}
+
+start() {
+ include /lib/network
+ scan_interfaces
+ config_load dhcp
+
+ args=""
+ config_foreach dhcp_add dhcp