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