set dnsmasq except-interface in init script to wan_ifname instead of vlan1
[openwrt.git] / openwrt / package / base-files / default / etc / init.d / S50dnsmasq
1 #!/bin/sh
2 . /etc/functions.sh
3 . /etc/network.overrides
4 [ "$FAILSAFE" != "true" -a -e /etc/config/network ] && . /etc/config/network
5
6 # interface to use for DHCP
7 iface=lan
8
9 ifname=$(nvram get ${iface}_ifname)
10 ipaddr=$(nvram get ${iface}_ipaddr)
11 netmask=$(nvram get ${iface}_netmask)
12
13 (
14 # check for existing DHCP server
15 udhcpc -n -q -R -s /dev/zero -i $ifname >&- || {
16
17 ipaddr=$(ip2int $ipaddr)
18 netmask=$(ip2int ${netmask:-255.255.255.0})
19 network=$((ipaddr&netmask))
20
21 start=$(nvram get dhcp_start)
22 start=$((network+${start:-100}))
23 end=$(nvram get dhcp_num)
24 end=$((start+${end:-150}))
25
26 args="-l /tmp/dhcp.leases -K -F $(int2ip $start),$(int2ip $end),$(int2ip $netmask),12h"
27 }
28 dnsmasq ${args}
29 ) &
This page took 0.062041 seconds and 5 git commands to generate.