aboutsummaryrefslogtreecommitdiffstats
path: root/mageia/usr/sbin/vpn-stop
blob: 048c909fa01de69f3d3c85d8217c90185f688c34 (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=/var/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