diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-07-30 03:09:09 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-07-30 03:09:09 +0000 |
commit | d3a6fe9915875cb78ca3d22f8330a0380dcd58a0 (patch) | |
tree | 3a7ec356cf8ec9ada9d0ddbf6ccbd1cbb9aae869 /package/dnsmasq | |
parent | d5aeb2645530079ac89ed72e2eee91fbcbc38e84 (diff) | |
download | upstream-d3a6fe9915875cb78ca3d22f8330a0380dcd58a0.tar.gz upstream-d3a6fe9915875cb78ca3d22f8330a0380dcd58a0.tar.bz2 upstream-d3a6fe9915875cb78ca3d22f8330a0380dcd58a0.zip |
rewrite of the network scripts and configuration
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4323 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/dnsmasq')
-rw-r--r-- | package/dnsmasq/files/dnsmasq.init | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init index 17ef43c3d5..140f727f46 100644 --- a/package/dnsmasq/files/dnsmasq.init +++ b/package/dnsmasq/files/dnsmasq.init @@ -1,5 +1,7 @@ #!/bin/sh -. /etc/config/network +. /etc/functions.sh +include network +scan_interfaces # The following is to automatically configure the DHCP settings # based on config settings. Feel free to replace all this crap @@ -10,7 +12,7 @@ args="" iface=lan -eval "ifname=\${${iface}_ifname}" +config_get ifname "$iface" ifname dhcp_enable="${dhcp_enable:-1}" dhcp_start="${dhcp_start:-100}" @@ -26,8 +28,8 @@ dhcp_lease="${dhcp_lease:-12h}" # no existing DHCP server? # calculate settings - eval "ipaddr=\${${iface}_ipaddr}" - eval "netmask=\${${iface}_netmask}" + config_get ipaddr "$iface" ipaddr + config_get netmask "$iface" netmask eval $(ipcalc $ipaddr $netmask ${dhcp_start:-100} ${dhcp_num:-150}) # and pass the args via config parser defines @@ -39,6 +41,8 @@ dhcp_lease="${dhcp_lease:-12h}" } # 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" cat /etc/dnsmasq.conf |