~alpine/aports

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch

[alpine-aports] [PATCH] main/openvpn: fix down script not restoring original resolv.conf

Chris Kankiewicz <chris@chriskankiewicz.com>
Details
Message ID
<1453324618-23532-1-git-send-email-Chris@ChrisKankiewicz.com>
Sender timestamp
1453324618
DKIM signature
missing
Download raw message
Patch: +2 -2
This patch fixes an error where, in the provided OpenVPN down script, the
cp command would fail due to the resolv.conf file already existing.

Instead of using cp we cat the file contents over the exising resolv.conf
file to avoid the error and preserve any symlinks that may exist.

Fixes issue #5027
---
 main/openvpn/openvpn.down | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/main/openvpn/openvpn.down b/main/openvpn/openvpn.down
index 1c70db0..ad8910e 100644
--- a/main/openvpn/openvpn.down
+++ b/main/openvpn/openvpn.down
@@ -13,9 +13,9 @@ if [ "${PEER_DNS}" != "no" ]; then
	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
		# Important that we cat instead of move incase resolv.conf is
		# a symlink and not an actual file
		cp /etc/resolv.conf-"${dev}".sv /etc/resolv.conf
		cat /etc/resolv.conf-"${dev}".sv > /etc/resolv.conf
		rm -f /etc/resolv.conf-"${dev}".sv
	fi
fi
-- 
2.5.0



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)