summaryrefslogtreecommitdiff
path: root/debian/openvpn.if-down.d
diff options
context:
space:
mode:
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