]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/dnsmasq
dnsmasq: Make command line customizeable.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / dnsmasq
index eaa55cef923a30f1f5780495613251ec5550c735..11859214b9e050b0d428cf23294f00b1a6095985 100644 (file)
 . /etc/sysconfig/rc
 . ${rc_functions}
 
+# Pull custom configuration file
+if [ -e "/etc/sysconfig/dnsmasq" ]; then
+       . /etc/sysconfig/dnsmasq
+fi
+
 SHOW_SRV=1
 
 case "${1}" in
@@ -28,16 +33,21 @@ case "${1}" in
                echo > /var/ipfire/red/resolv.conf # Clear it
                if [ -e "/var/ipfire/red/dns1" ]; then
                    DNS1=$(cat /var/ipfire/red/dns1 2>/dev/null)
-                   echo "nameserver ${DNS1}" >> /var/ipfire/red/resolv.conf
+                   if [ ! -z ${DNS1} ]; then
+                       echo "nameserver ${DNS1}" >> /var/ipfire/red/resolv.conf
+                   fi
                fi
                if [ -e "/var/ipfire/red/dns2" ]; then
                    DNS2=$(cat /var/ipfire/red/dns2 2>/dev/null)
-                   echo "nameserver ${DNS2}" >> /var/ipfire/red/resolv.conf
+                   if [ ! -z ${DNS2} ]; then
+                       echo "nameserver ${DNS2}" >> /var/ipfire/red/resolv.conf
+                   fi
                fi
                [ -e "/var/ipfire/red/active" ] && ARGS="$ARGS -r /var/ipfire/red/resolv.conf"
                
                ARGS="$ARGS --domain=`cat /var/ipfire/main/settings |grep DOMAIN |cut -d = -f 2`"
-               
+               ARGS="$ARGS $CUSTOM_ARGS"
+
                loadproc /usr/sbin/dnsmasq -l /var/state/dhcp/dhcpd.leases $ARGS
                
                if [ "${SHOW_SRV}" -eq 1 ] && [ "${DNS1}" != "" -o "${DNS2}" != "" ]; then