diff options
author | Chris Kankiewicz <chris@chriskankiewicz.com> | 2016-01-20 14:16:58 -0700 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-01-26 21:53:54 +0000 |
commit | bfdc08d49cfd221709ce29ad6f81a651461c71e2 (patch) | |
tree | 3ffcb078644bdb440e700ea373c2e2f21b1eb9f4 /main/openvpn/openvpn.down | |
parent | d312648c4ac76e655f817783860fe16c370d8e88 (diff) | |
download | aports-bfdc08d49cfd221709ce29ad6f81a651461c71e2.tar.bz2 aports-bfdc08d49cfd221709ce29ad6f81a651461c71e2.tar.xz |
main/openvpn: fix down script not restoring original resolv.conf
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
Diffstat (limited to 'main/openvpn/openvpn.down')
-rw-r--r-- | main/openvpn/openvpn.down | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/openvpn/openvpn.down b/main/openvpn/openvpn.down index 1c70db0ec6..ad8910e8f3 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 |