#
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=dnsmasq
PKG_VERSION:=2.55
-PKG_RELEASE:=6
+PKG_RELEASE:=6.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
local cfg="$1"
local ip name names
- config_get names "$cfg" name
+ config_get names "$cfg" name "$2"
[ -n "$names" ] || return 0
- config_get ip "$cfg" ip
+ config_get ip "$cfg" ip "$3"
[ -n "$ip" ] || return 0
local oIFS="$IFS"; IFS="."; set -- $ip; IFS="$oIFS"
start() {
include /lib/network
scan_interfaces
+
+ local lanaddr
+ config_get lanaddr "lan" ipaddr
+
config_load dhcp
args=""
config_foreach dhcp_domain_add domain
config_foreach dhcp_add dhcp
+ # add own hostname
+ [ -z "$lanaddr" ] || {
+ local hostname="$(uci_get system.@system[0].hostname)"
+ dhcp_domain_add "" "${hostname:-OpenWrt}" "$lanaddr"
+ }
+
/usr/sbin/dnsmasq $args && {
rm -f /tmp/resolv.conf
[ -n "$DOMAIN" ] && echo "search $DOMAIN" >> /tmp/resolv.conf