aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--initscripts.spec6
-rw-r--r--sysconfig/network-scripts/network-functions8
2 files changed, 11 insertions, 3 deletions
diff --git a/initscripts.spec b/initscripts.spec
index 30379e88..a7f10a52 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -1,6 +1,6 @@
Summary: The inittab file and the /etc/init.d scripts.
Name: initscripts
-Version: 7.66
+Version: 7.67
License: GPL
Group: System Environment/Base
Release: 1
@@ -250,6 +250,10 @@ rm -rf $RPM_BUILD_ROOT
%ghost %attr(0664,root,utmp) /var/run/utmp
%changelog
+* Mon Aug 20 2004 Jason Vas Dias <jvdias@redhat.com> 7.67-1
+- fix change_resolv_conf: if pre-existing /etc/resolv.conf
+- non-existent or empty, replace with new file contents.
+
* Fri Aug 20 2004 Jason Vas Dias <jvdias@redhat.com> 7.66-1
- Allow users to use generic /etc/dhclient.conf if per-device
- /etc/dhclient-${DEVICE}.conf is non-existent or empty
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=$?