Remove empty nameserver entry from resolv.conf.
authorArne Fitzenreiter <arne_f@ipfire.org>
Thu, 8 Jul 2010 22:34:11 +0000 (00:34 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Thu, 8 Jul 2010 22:34:11 +0000 (00:34 +0200)
config/rootfiles/core/39/filelists/files
src/initscripts/init.d/dnsmasq

index f1526f0..5b9c934 100644 (file)
@@ -1,4 +1,5 @@
 etc/system-release
+etc/rc.d/init.d/dnsmasq
 etc/rc.d/init.d/networking/red
 etc/rc.d/helper/getdnsfromdhcpc.pl
 srv/web/ipfire/cgi-bin/pppsetup.cgi
index eaa55ce..0dfb1f4 100644 (file)
@@ -28,11 +28,15 @@ 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"