summaryrefslogtreecommitdiff
path: root/debian/openvpn.if-up.d
blob: a6548a5e369ae4882a4aac9ae2faa8ed4f90ac85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

OPENVPN=/usr/sbin/openvpn
OPENVPN_INIT=/etc/init.d/openvpn
SYSTEMCTL=/bin/systemctl

if [ ! -x $OPENVPN ]; then
  exit 0
fi

if [ -n "$IF_OPENVPN" ]; then
  for vpn in $IF_OPENVPN; do
    ## check systemd present
    if [ -x $SYSTEMCTL ]; then
      $SYSTEMCTL start openvpn@$vpn
    else
      $OPENVPN_INIT start $vpn
    fi
  done
fi