summaryrefslogtreecommitdiff
path: root/debian/openvpn.if-down.d
diff options
context:
space:
mode:
authorAlberto Gonzalez Iniesta <agi@inittab.org>2014-03-14 13:02:21 +0100
committerAlberto Gonzalez Iniesta <agi@inittab.org>2014-03-14 13:54:18 +0100
commit3125e393084124442e409bef697847a1f87fc531 (patch)
tree31ff50b7324b4c12e8ea3fa1f9e573f9e59416d0 /debian/openvpn.if-down.d
parent1f88813d1b92c4143e4b47d853c62c9868ed501b (diff)
Add systemd support
Diffstat (limited to 'debian/openvpn.if-down.d')
-rw-r--r--debian/openvpn.if-down.d11
1 files changed, 9 insertions, 2 deletions
diff --git a/debian/openvpn.if-down.d b/debian/openvpn.if-down.d
index 4610786..77cfb79 100644
--- a/debian/openvpn.if-down.d
+++ b/debian/openvpn.if-down.d
@@ -1,6 +1,8 @@
#!/bin/sh
-OPENVPN=/etc/init.d/openvpn
+OPENVPN=/usr/sbin/openvpn
+OPENVPN_INIT=/etc/init.d/openvpn
+SYSTEMCTL=/bin/systemctl
if [ ! -x $OPENVPN ]; then
exit 0
@@ -8,6 +10,11 @@ fi
if [ -n "$IF_OPENVPN" ]; then
for vpn in $IF_OPENVPN; do
- $OPENVPN stop $vpn
+ ## check systemd present
+ if [ -x $SYSTEMCTL ]; then
+ $SYSTEMCTL stop openvpn@$vpn
+ else
+ $OPENVPN_INIT stop $vpn
+ fi
done
fi