aboutsummaryrefslogtreecommitdiffstats
path: root/main/openvpn/openvpn.down
diff options
context:
space:
mode:
authorChris Kankiewicz <chris@chriskankiewicz.com>2016-01-20 14:16:58 -0700
committerNatanael Copa <ncopa@alpinelinux.org>2016-01-26 23:11:23 +0100
commit34c1dfa8655f06054a8d3bfe37a555ab78926d82 (patch)
tree3cf94e320da3bb8e0e11adc2db462b70fd903e1e /main/openvpn/openvpn.down
parent9b9b6d39b24a148f2c8cc0a1f5b4b41bef202c64 (diff)
downloadaports-34c1dfa8655f06054a8d3bfe37a555ab78926d82.tar.bz2
aports-34c1dfa8655f06054a8d3bfe37a555ab78926d82.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 #5027 (cherry picked from commit bfdc08d49cfd221709ce29ad6f81a651461c71e2)
Diffstat (limited to 'main/openvpn/openvpn.down')
-rw-r--r--main/openvpn/openvpn.down4
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