aboutsummaryrefslogtreecommitdiffstats
path: root/mageia/usr/sbin/vpn-stop
blob: 48863868433b62cdef88e4993144887fd9cdea41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

TYPE=$1
NAME=$2
if [ -z "$TYPE" ] || [ -z "$NAME" ]; then
   echo "usage: $0: <VPN type> <VPN name>"
fi

PID=/run/"$TYPE"-"$NAME".pid

. /etc/init.d/functions
if [ -e "$PID" ]; then
    gprintf "Stopping VPN connection: "
    killproc -p "$PID"
    echo
else
    gprintf "Connection isn't started.\n"
fi