summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2006-05-12 10:57:48 +0000
committerRoy Marples <uberlord@gentoo.org>2006-05-12 10:57:48 +0000
commit2d90bfe5c7ca472b7442552d9ef0e559296df42b (patch)
treee756f149b1df589fd028e123608737e8660ef03b /net-misc
parentChanged SF cvs to new host, #133081. Tweaked depends a little. (diff)
downloadgentoo-2-2d90bfe5c7ca472b7442552d9ef0e559296df42b.tar.gz
gentoo-2-2d90bfe5c7ca472b7442552d9ef0e559296df42b.tar.bz2
gentoo-2-2d90bfe5c7ca472b7442552d9ef0e559296df42b.zip
up.sh and down.sh now save and restore resolv.conf if we don't
have resolvconf installed, #132932. (Portage version: 2.1_pre10-r5)
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/openvpn/ChangeLog6
-rwxr-xr-xnet-misc/openvpn/files/down.sh11
-rwxr-xr-xnet-misc/openvpn/files/up.sh4
3 files changed, 18 insertions, 3 deletions
diff --git a/net-misc/openvpn/ChangeLog b/net-misc/openvpn/ChangeLog
index 140110b8fc08..1edacb26b50a 100644
--- a/net-misc/openvpn/ChangeLog
+++ b/net-misc/openvpn/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for net-misc/openvpn
# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.86 2006/05/10 08:43:49 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/openvpn/ChangeLog,v 1.87 2006/05/12 10:57:48 uberlord Exp $
+
+ 12 May 2006; Roy Marples <uberlord@gentoo.org> files/down.sh, files/up.sh:
+ up.sh and down.sh now save and restore resolv.conf if we don't
+ have resolvconf installed, #132932.
10 May 2006; Roy Marples <uberlord@gentoo.org> openvpn-2.1_beta14.ebuild,
files/up.sh:
diff --git a/net-misc/openvpn/files/down.sh b/net-misc/openvpn/files/down.sh
index 98a9104e8db6..321ca7bbfaa5 100755
--- a/net-misc/openvpn/files/down.sh
+++ b/net-misc/openvpn/files/down.sh
@@ -8,8 +8,15 @@ if [[ -x /etc/openvpn/"${SVCNAME}"-down.sh ]] ; then
( /etc/openvpn/"${SVCNAME}"-down.sh )
fi
-# Setup our resolv.conf
-[[ -x /sbin/resolvconf ]] && /sbin/resolvconf -d "${dev}"
+# Restore resolv.conf to how it was
+if [[ -x /sbin/resolvconf ]] ; then
+ /sbin/resolvconf -d "${dev}"
+elif [[ -e /etc/resolv.conf-"${dev}".sv ]] ; then
+ # Important that we copy instead of move incase resolv.conf is
+ # a symlink and not an actual file
+ cp /etc/resolv.conf-"${dev}".sv /etc/resolv.conf
+ rm -f /etc/resolv.conf-"${dev}".sv
+fi
# Re-enter the init script to start any dependant services
if /etc/init.d/"${SVCNAME}" --quiet status ; then
diff --git a/net-misc/openvpn/files/up.sh b/net-misc/openvpn/files/up.sh
index 7e6c0719d4aa..f950577532b7 100755
--- a/net-misc/openvpn/files/up.sh
+++ b/net-misc/openvpn/files/up.sh
@@ -19,6 +19,10 @@ if [[ -n ${DNS} ]] ; then
if [[ -x /sbin/resolvconf ]] ; then
echo -e "${DNS}" | /sbin/resolvconf -a "${dev}"
else
+ # Preserve the existing resolv.conf
+ if [[ -e /etc/resolv.conf ]] ; then
+ cp /etc/resolv.conf /etc/resolv.conf-"${dev}".sv
+ fi
echo -e "${DNS}" > /etc/resolv.conf
chmod 644 /etc/resolv.conf
fi