X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Finitscripts%2Finit.d%2Fdnsmasq;fp=src%2Finitscripts%2Finit.d%2Fdnsmasq;h=b033e2b4c88645623f667537be18e27a5fde3a86;hp=4e37925171a4687d056f4f93ef3ec7b317ed8e3d;hb=28fee67640d1c1f5ddc692c1c7f073fa8f115d3c;hpb=b510e12ac1deb8ac93fcfa7dc62a505affe0fdee diff --git a/src/initscripts/init.d/dnsmasq b/src/initscripts/init.d/dnsmasq index 4e37925171..b033e2b4c8 100644 --- a/src/initscripts/init.d/dnsmasq +++ b/src/initscripts/init.d/dnsmasq @@ -54,6 +54,21 @@ function dns_forward_args() { echo "${cmdline}" } +function dns_leases_args() { + eval $(/usr/local/bin/readhash /var/ipfire/dhcp/settings) + + # If the DHCP server is enabled and DNS Update (RFC2136) is + # enabled, too, we won't overlay the internal domain with + # the dynamic/static leases. + + if ([ "${ENABLE_GREEN}" = "on" ] || [ "${ENABLE_BLUE}" = "on" ]) \ + && [ "${DNS_UPDATE_ENABLED}" = "on" ]; then + return + fi + + echo "-l /var/state/dhcp/dhcpd.leases" +} + case "${1}" in start) # kill already running copy of dnsmasq... @@ -64,7 +79,10 @@ case "${1}" in eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings) ARGS="$CUSTOM_ARGS" [ "$DOMAIN_NAME_GREEN" != "" ] && ARGS="$ARGS -s $DOMAIN_NAME_GREEN" - + + # DHCP configuration + ARGS="${ARGS} $(dns_leases_args)" + echo > /var/ipfire/red/resolv.conf # Clear it if [ -e "/var/ipfire/red/dns1" ]; then DNS1=$(cat /var/ipfire/red/dns1 2>/dev/null) @@ -94,7 +112,7 @@ case "${1}" in ARGS="${ARGS} --cache-size=${CACHE_SIZE}" fi - loadproc /usr/sbin/dnsmasq -l /var/state/dhcp/dhcpd.leases $ARGS + loadproc /usr/sbin/dnsmasq ${ARGS} if [ "${SHOW_SRV}" -eq 1 ] && [ "${DNS1}" != "" -o "${DNS2}" != "" ]; then boot_mesg "Using DNS server(s): ${DNS1} ${DNS2}"