aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThan Ngo <than@redhat.com>2000-04-04 08:29:10 +0000
committerThan Ngo <than@redhat.com>2000-04-04 08:29:10 +0000
commitc90a4e556cd66f20016f9e38d0e5b9eeb65bea13 (patch)
tree299ca48354dd353ef47df8332a50ada4f439c5c7
parentcc71b1d4eb728893e4133ef99937401d33f57c6c (diff)
downloadinitscripts-c90a4e556cd66f20016f9e38d0e5b9eeb65bea13.tar
initscripts-c90a4e556cd66f20016f9e38d0e5b9eeb65bea13.tar.gz
initscripts-c90a4e556cd66f20016f9e38d0e5b9eeb65bea13.tar.bz2
initscripts-c90a4e556cd66f20016f9e38d0e5b9eeb65bea13.tar.xz
initscripts-c90a4e556cd66f20016f9e38d0e5b9eeb65bea13.zip
fix overwrite problem of resolv.conf on ippp/ppp/slip connections
-rw-r--r--ChangeLog5
-rw-r--r--initscripts.spec3
-rwxr-xr-xsysconfig/network-scripts/ifdown-post6
-rwxr-xr-xsysconfig/network-scripts/ifup-post5
4 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a3f51a8..9075d6aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-04-04 Ngo Than <than@redhat.de>
+
+ * sysconfig/network-scripts/ifup-post, sysconfig/network-scripts/ifdown-post
+ fix overwrite problem of resolv.conf on ppp/ippp/slip connections
+
2000-04-03 Bill Nottingham <notting@redhat.com>
* src/ppp-watch.c:
diff --git a/initscripts.spec b/initscripts.spec
index 5c9d75e8..32b01366 100644
--- a/initscripts.spec
+++ b/initscripts.spec
@@ -215,6 +215,9 @@ rm -rf $RPM_BUILD_ROOT
%ghost %attr(0664,root,utmp) /var/run/utmp
%changelog
+* Tue Apr 04 2000 Ngo Than <than@redhat.de>
+- fix overwrite problem of resolv.conf on ippp/ppp/slip connections
+
* Mon Apr 3 2000 Bill Nottingham <notting@redhat.com>
- fix typo in functions file
- explicitly set --localtime when calling hwclock if necessary
diff --git a/sysconfig/network-scripts/ifdown-post b/sysconfig/network-scripts/ifdown-post
index 9e2501d3..63cb63f6 100755
--- a/sysconfig/network-scripts/ifdown-post
+++ b/sysconfig/network-scripts/ifdown-post
@@ -10,6 +10,12 @@ cd /etc/sysconfig/network-scripts
CONFIG=$1
source_config
+DEVICETYPE=`echo $DEVICE | sed "s/[0-9]*$//"`
+
+if [ "${DEVICETYPE}" = "ppp" -o "${DEVICETYPE}" = "ippp" ]; then
+ [ -f /etc/resolv.conf.save ] && cat /etc/resolv.conf.save > /etc/resolv.conf
+fi
+
# Reset the default route if this interface had a special one
if ! check_default_route ; then
add_default_route
diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post
index 4f146058..76d00e4c 100755
--- a/sysconfig/network-scripts/ifup-post
+++ b/sysconfig/network-scripts/ifup-post
@@ -72,7 +72,10 @@ if [ "$PEERDNS" != "no" -o "$RESOLV_MODS" != "no" ]; then
echo "search $DOMAIN $search" >> $tr
fi
done
-
+
+ # backup resolv.conf
+ cp -af /etc/resolv.conf /etc/resolv.conf.save
+
# maintain permissions
# but set umask in case it doesn't exist!
oldumask=`umask`