From 69ed8e952e7bd9c7c9bf3d4eee42e15d012dc315 Mon Sep 17 00:00:00 2001 From: Jason Vas Dias Date: Mon, 23 Aug 2004 18:48:14 +0000 Subject: fix resolv.conf merge if pre-existing resolv.conf nonexistent or empty --- sysconfig/network-scripts/network-functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sysconfig/network-scripts/network-functions') 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=$? -- cgit v1.2.1