added vpn scripts and openvpn dependencies

This commit is contained in:
2019-07-03 23:10:57 +02:00
parent 2df2c4e7b1
commit a70b7b18a6
3 changed files with 21 additions and 0 deletions

17
i3/scripts/vpn-manager.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
# VPN = list con | skip first line, if type == vpn print name | show in rofi
VPN=$(nmcli con | awk 'NR>1 && $3 == "vpn" {print $1}' | rofi -dmenu -p "Select a vpn to (dis)connect")
# if $VPN not set, exit.
[ -z "$VPN" ] && exit
# Check whether vpn is activated
STATE=$(nmcli con show "$VPN" | grep GENERAL.STATE: | awk '{print $2}')
# if state == activated
if [ "$STATE" == "activated" ]; then
nmcli con down "$VPN"
else
nmcli con up "$VPN"
fi