From c90a4e556cd66f20016f9e38d0e5b9eeb65bea13 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Tue, 4 Apr 2000 08:29:10 +0000 Subject: fix overwrite problem of resolv.conf on ippp/ppp/slip connections --- sysconfig/network-scripts/ifdown-post | 6 ++++++ sysconfig/network-scripts/ifup-post | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'sysconfig/network-scripts') 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` -- cgit v1.2.1