4 # interface to use for DHCP
7 ifname
=$
(nvram get
${iface}_ifname
)
8 ipaddr
=$
(nvram get
${iface}_ipaddr
)
9 netmask
=$
(nvram get
${iface}_netmask
)
11 # check for existing DHCP server
12 udhcpc
-n -q -R -s /bin
/true
-i $ifname >&- ||
{
14 ipaddr
=$
(ip2int
$ipaddr)
15 netmask
=$
(ip2int
${netmask:-255.255.255.0})
16 network
=$
((ipaddr
&netmask
))
18 start
=$
(nvram get dhcp_start
)
19 start
=$
((network
+${start:-100}))
20 end
=$
(nvram get dhcp_num
)
21 end
=$
((start
+${end:-150}))
23 wanproto
=$
(nvram get wan_proto
)
24 [ -z "$wanproto" -o "$wanproto" = "none" ] || wanif
=$
(nvram get wan_ifname
)
26 args
="-l /tmp/dhcp.leases -K -F $(int2ip $start),$(int2ip $end),$(int2ip $netmask),12h ${wanif:+-I ${wanif} }"
This page took 0.040045 seconds and 5 git commands to generate.