aboutsummaryrefslogtreecommitdiffstats
path: root/package/dnsmasq/files/dnsmasq.init
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-04-02 22:56:22 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-04-02 22:56:22 +0000
commita8e904a9587c03c01a3fb43de1afca26e8da9a5e (patch)
treeb8bf1c05b932dff6012158266bf006be6f0c4f4d /package/dnsmasq/files/dnsmasq.init
parente3a9d80e8fcd84c0a01615c15d4b62430fd95087 (diff)
downloadupstream-a8e904a9587c03c01a3fb43de1afca26e8da9a5e.tar.gz
upstream-a8e904a9587c03c01a3fb43de1afca26e8da9a5e.tar.bz2
upstream-a8e904a9587c03c01a3fb43de1afca26e8da9a5e.zip
dnsmasq: allow multiple hostnames per domain section
SVN-Revision: 20656
Diffstat (limited to 'package/dnsmasq/files/dnsmasq.init')
-rw-r--r--package/dnsmasq/files/dnsmasq.init14
1 files changed, 10 insertions, 4 deletions
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init
index 1b6dee426a..4cd941cfd7 100644
--- a/package/dnsmasq/files/dnsmasq.init
+++ b/package/dnsmasq/files/dnsmasq.init
@@ -284,16 +284,22 @@ dhcp_option_add() {
dhcp_domain_add() {
local cfg="$1"
+ local ip name names
- config_get name "$cfg" name
- [ -n "$name" ] || return 0
+ config_get names "$cfg" name
+ [ -n "$names" ] || return 0
config_get ip "$cfg" ip
[ -n "$ip" ] || return 0
local oIFS="$IFS"; IFS="."; set -- $ip; IFS="$oIFS"
- append args "-A /$name${DOMAIN:+.$DOMAIN}/$ip"
- append args "--ptr-record=$4.$3.$2.$1.in-addr.arpa,$name${DOMAIN:+.$DOMAIN}"
+ local raddr="${4:+$4.$3.$2.$1.in-addr.arpa}"
+
+ for name in $names; do
+ append args "-A /$name${DOMAIN:+.$DOMAIN}/$ip"
+ [ -n "$raddr" ] && \
+ append args "--ptr-record=$raddr,$name${DOMAIN:+.$DOMAIN}"
+ done
}
start() {