File: openvpn.if-down.d

package info (click to toggle)
openvpn 2.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 10,476 kB
  • sloc: ansic: 90,938; sh: 5,519; makefile: 689; javascript: 73; perl: 66; python: 47
file content (21 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

OPENVPN=/usr/sbin/openvpn
OPENVPN_INIT=/etc/init.d/openvpn
SYSTEMCTL=/bin/systemctl
SYSTEMD=/run/systemd/system

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

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