aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorJason Vas Dias <jvdias@redhat.com>2004-08-23 18:48:14 +0000
committerJason Vas Dias <jvdias@redhat.com>2004-08-23 18:48:14 +0000
commit69ed8e952e7bd9c7c9bf3d4eee42e15d012dc315 (patch)
tree50de7243ed8b35135cae8852caab534b12a79fbf /sysconfig
parent9730d9b8719dfcff60236decc9f7a0329c031bee (diff)
downloadinitscripts-69ed8e952e7bd9c7c9bf3d4eee42e15d012dc315.tar
initscripts-69ed8e952e7bd9c7c9bf3d4eee42e15d012dc315.tar.gz
initscripts-69ed8e952e7bd9c7c9bf3d4eee42e15d012dc315.tar.bz2
initscripts-69ed8e952e7bd9c7c9bf3d4eee42e15d012dc315.tar.xz
initscripts-69ed8e952e7bd9c7c9bf3d4eee42e15d012dc315.zip
fix resolv.conf merge if pre-existing resolv.conf nonexistent or emptyr7-67
Diffstat (limited to 'sysconfig')
-rw-r--r--sysconfig/network-scripts/network-functions8
1 files changed, 6 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 8b78b17d..a3dd9670 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -360,7 +360,7 @@ configure_ccwgroup_device ()
# Invoke this when /etc/resolv.conf has changed:
change_resolv_conf ()
{
- s=`/bin/grep '^[\ \ ]*option' /etc/resolv.conf`;
+ s=`/bin/grep '^[\ \ ]*option' /etc/resolv.conf 2>/dev/null`;
if [ "x$s" != "x" ]; then
s="$s"$'\n';
fi;
@@ -380,7 +380,11 @@ change_resolv_conf ()
let n_args=n_args-1;
done;
elif [ $# -eq 1 ]; then
- s="$s"`/bin/grep -vF "$s" $1`;
+ if [ "x$s" != "x" ]; then
+ s="$s"`/bin/grep -vF "$s" $1`;
+ else
+ s=`cat $1`;
+ fi;
fi;
(echo "$s" > /etc/resolv.conf;) >/dev/null 2>&1;
r=$?