~alpine/aports

main/openvpn: fix down script not restoring original resolv.conf v1 PROPOSED

Chris Kankiewicz: 1
 main/openvpn: fix down script not restoring original resolv.conf

 1 files changed, 2 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/aports/patches/2125/mbox | git am -3
Learn more about email & git

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

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
---