summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/openvpn/files/up.sh')
-rwxr-xr-xnet-misc/openvpn/files/up.sh4
1 files changed, 4 insertions, 0 deletions
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