diff options
author | Alberto Gonzalez Iniesta <agi@inittab.org> | 2014-03-14 13:02:21 +0100 |
---|---|---|
committer | Alberto Gonzalez Iniesta <agi@inittab.org> | 2014-03-14 13:54:18 +0100 |
commit | 3125e393084124442e409bef697847a1f87fc531 (patch) | |
tree | 31ff50b7324b4c12e8ea3fa1f9e573f9e59416d0 /debian/openvpn.if-up.d | |
parent | 1f88813d1b92c4143e4b47d853c62c9868ed501b (diff) |
Add systemd support
Diffstat (limited to 'debian/openvpn.if-up.d')
-rw-r--r-- | debian/openvpn.if-up.d | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/debian/openvpn.if-up.d b/debian/openvpn.if-up.d index 539112a..a6548a5 100644 --- a/debian/openvpn.if-up.d +++ b/debian/openvpn.if-up.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 start $vpn + ## check systemd present + if [ -x $SYSTEMCTL ]; then + $SYSTEMCTL start openvpn@$vpn + else + $OPENVPN_INIT start $vpn + fi done fi |