treewide: avoid double-escaping CBI section labels
[project/luci.git] / contrib / package / meshwizard / files / usr / bin / meshwizard / helpers / setup_dnsmasq.sh
index 26a896bc7ba982ebbcc6a7dccfedc38636eef0ac..9297f9175edcbf9f25bc9f399039886cad38d346 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-. /etc/functions.sh
+. /lib/functions.sh
 . $dir/functions.sh
 
 # Set dnsmasq config
@@ -13,12 +13,17 @@ handle_dhcp() {
 config_load dhcp
 config_foreach handle_dhcp dnsmasq
 
-uci set dhcp.dnsmasq.local="/$profile_suffix/"
-uci set dhcp.dnsmasq.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"
+       if [ "$ipv6_enabled" = 1 ]; then
+               uci add_list dhcp.dnsmasq.addnhosts="/var/etc/hosts.olsr.ipv6"
+       fi
 fi
 
 uci_commitverbose "Setup dnsmasq" dhcp