-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVPN-Monitor
More file actions
executable file
·25 lines (22 loc) · 903 Bytes
/
VPN-Monitor
File metadata and controls
executable file
·25 lines (22 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
###########################################################################
# When the status of the VPN interface changes, check the profile #
# that is being used. If it matches, enable the killswitch. #
# #
# Make sure to change VPNIFACE, PROFILE and PATH #
###########################################################################
IF=$1
STATUS=$2
VPNIFACE="ppp0"
PROFILE="Warzone"
PATH=/home/tiago/VPN-Killswitch
if [ "$IF" == "$VPNIFACE" ]
then
case "$2" in
vpn-up)
if /usr/bin/nmcli con show --active | /bin/grep "$PROFILE" > /dev/null 2>&1; then $PATH --activate && /usr/bin/logger "VPN-Killswitch ENABLED"; else /usr/bin/logger "VPN-Killswitch - Not the specified profile. Doing nothing."; fi
;;
*)
;;
esac
fi