summaryrefslogtreecommitdiff
path: root/user/openvpn/openvpn.down
diff options
context:
space:
mode:
authorLee Starnes <lee@canned-death.us>2018-09-08 01:30:48 +0000
committerLee Starnes <lee@canned-death.us>2018-09-08 01:30:48 +0000
commit3a6b23a5d7d750bf28a1f968700fa809d5ad7aaa (patch)
tree88f8936a8bb8ffa73a434c7a7ec60eb307750b2d /user/openvpn/openvpn.down
parent15152598729dfaa1d6535b564f343c5d6785c01a (diff)
downloadpackages-3a6b23a5d7d750bf28a1f968700fa809d5ad7aaa.tar.gz
packages-3a6b23a5d7d750bf28a1f968700fa809d5ad7aaa.tar.bz2
packages-3a6b23a5d7d750bf28a1f968700fa809d5ad7aaa.tar.xz
packages-3a6b23a5d7d750bf28a1f968700fa809d5ad7aaa.zip
user/openvpn: pull in
Diffstat (limited to 'user/openvpn/openvpn.down')
-rw-r--r--user/openvpn/openvpn.down33
1 files changed, 33 insertions, 0 deletions
diff --git a/user/openvpn/openvpn.down b/user/openvpn/openvpn.down
new file mode 100644
index 000000000..50d463f16
--- /dev/null
+++ b/user/openvpn/openvpn.down
@@ -0,0 +1,33 @@
+#!/bin/sh
+# Copyright (c) 2006-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Contributed by Roy Marples (uberlord@gentoo.org)
+
+# If we have a service specific script, run this now
+if [ -x /etc/openvpn/"${RC_SVCNAME}"-down.sh ] ; then
+ /etc/openvpn/"${RC_SVCNAME}"-down.sh "$@"
+fi
+
+# Restore resolv.conf to how it was
+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 cat instead of move incase resolv.conf is
+ # a symlink and not an actual file
+ cat /etc/resolv.conf-"${dev}".sv > /etc/resolv.conf
+ rm -f /etc/resolv.conf-"${dev}".sv
+ fi
+fi
+
+if [ -n "${RC_SVCNAME}" ]; then
+ # Re-enter the init script to start any dependant services
+ if /etc/init.d/"${RC_SVCNAME}" --quiet status ; then
+ export IN_BACKGROUND=true
+ /etc/init.d/"${RC_SVCNAME}" --quiet stop
+ fi
+fi
+
+exit 0
+
+# vim: ts=4 :