package/kernel: add another round of missing bits from [21137] & [21138] (oops again)
[openwrt.git] / package / dnsmasq / files / dnsmasq.init
index 1b6dee4..15f856d 100644 (file)
@@ -284,16 +284,30 @@ 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
+               local fqdn="$name"
+
+               [ "${fqdn%.*}" == "$fqdn" ] && \
+                       fqdn="$fqdn${DOMAIN:+.$DOMAIN}"
+
+               append args "-A /$fqdn/$ip"
+               
+               [ -n "$raddr" ] && {
+                       append args "--ptr-record=$raddr,$fqdn"
+                       raddr=""
+               }
+       done
 }
 
 start() {
This page took 0.021219 seconds and 4 git commands to generate.