dnsmasq: add dnsmasq.d config folder & improve odhcpd coexistence
authorSteven Barth <cyrus@openwrt.org>
Fri, 17 Jan 2014 14:00:09 +0000 (14:00 +0000)
committerSteven Barth <cyrus@openwrt.org>
Fri, 17 Jan 2014 14:00:09 +0000 (14:00 +0000)
SVN-Revision: 39312

package/network/services/dnsmasq/files/dnsmasq.init

index 0ff987f69c46eeb66ba9c7a9961f6bac417c4383..b5fb58c524687b1081b2e20c1c3efdd540cb185e 100644 (file)
@@ -158,8 +158,9 @@ dnsmasq() {
        config_get hostsfile "$cfg" dhcphostsfile
        [ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"
 
-       mkdir -p /tmp/hosts
+       mkdir -p /tmp/hosts /tmp/dnsmasq.d
        xappend "--addn-hosts=/tmp/hosts"
+       xappend "--conf-dir=/tmp/dnsmasq.d"
 
        local rebind
        config_get_bool rebind "$cfg" rebind_protection 1
@@ -559,7 +560,12 @@ start_service() {
        config_foreach dhcp_srv_add srvhost
        config_foreach dhcp_mx_add mxhost
        echo >> $CONFIGFILE
-       config_foreach dhcp_add dhcp
+
+       config_get odhcpd_is_active odhcpd maindhcp
+       if [ "$odhcpd_is_active" != "1" ]; then
+               config_foreach dhcp_add dhcp
+       fi
+
        echo >> $CONFIGFILE
        config_foreach dhcp_cname_add cname
        echo >> $CONFIGFILE