diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-04-02 22:56:22 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-04-02 22:56:22 +0000 |
commit | 67d446094f5b5484546c536195d23e2567609717 (patch) | |
tree | 615471cf887da57ee23d1943a9765c118255404a /package/dnsmasq/files | |
parent | 9c792285770b4f0ec21dcea72039fd4f82cbe425 (diff) | |
download | upstream-67d446094f5b5484546c536195d23e2567609717.tar.gz upstream-67d446094f5b5484546c536195d23e2567609717.tar.bz2 upstream-67d446094f5b5484546c536195d23e2567609717.zip |
[package] dnsmasq: allow multiple hostnames per domain section
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20656 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/dnsmasq/files')
-rw-r--r-- | package/dnsmasq/files/dnsmasq.init | 14 |
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() { |