Strip new lines when echoing resolv.conf files per interface.
authorRoy Marples <roy@marples.name>
Sun, 24 Aug 2008 08:02:33 +0000 (08:02 +0000)
committerRoy Marples <roy@marples.name>
Sun, 24 Aug 2008 08:02:33 +0000 (08:02 +0000)
resolvconf.in

index d694ad6b8ae74c81ce3389a70e9fe28335674b6f..1512c6fd2c7bc49d5ca3fe9e7e3724950e7c844f 100755 (executable)
@@ -65,9 +65,15 @@ usage()
 
 echo_resolv()
 {
+       local LINE=
        [ -n "$1" -a -e "${IFACEDIR}/$1" ] || return 1
        echo "# resolv.conf from $1"
-       cat "${IFACEDIR}/$1"
+       # Our variable maker works of the fact each resolv.conf per interface
+       # is separated by blank lines.
+       # So we remove them when echoing them.
+       while read LINE; do
+               [ -n "${LINE}" ] && echo "${LINE}"
+       done < "${IFACEDIR}/$1"
        echo
 }