contrib/meshwizard: Add initial support for ipv6 config (with auto-ipv6-ib and dhcpv6)
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / helpers / setup_dnsmasq.sh
index 517b4fd..504aaee 100755 (executable)
@@ -13,19 +13,17 @@ handle_dhcp() {
 config_load dhcp
 config_foreach handle_dhcp dnsmasq
 
-echo "    + Setup dnsmasq"
-
-uci set dhcp.dnsmasq.local="/$profile_suffix/"
-uci set dhcp.dnsmasq.domain="$profile_suffix"
-
-echo "    local: /$profile_suffix/
-    domain: $profile_suffix"
+uci batch << EOF
+       set dhcp.dnsmasq.local="/$profile_suffix/"
+       set dhcp.dnsmasq.domain="$profile_suffix"
+EOF
 
 config_get addnhosts dnsmasq addnhosts
 if [ -z "${addnhosts/\var\/etc\/hosts.olsr/}" ]; then
        uci add_list dhcp.dnsmasq.addnhosts="/var/etc/hosts.olsr"
-       echo "    addnhosts: /var/etc/hosts.olsr"
+       if [ "$profile_ipv6" = 1 ]; then
+               uci add_list dhcp.dnsmasq.addnhosts="/var/etc/hosts.olsr.ipv6"
+       fi
 fi
 
-uci commit
-
+uci_commitverbose "Setup dnsmasq" dhcp