dotfiles/.local/bin/tools/ethvpn

13 lines
428 B
Plaintext
Raw Normal View History

2020-08-17 19:29:27 +02:00
#!/bin/sh
user="abocken@student-net.ethz.ch"
password_path="ETH/VPN"
if [ $(pgrep -c openconnect) -eq 0 ]; then
pass "$password_path" | sudo openconnect -g student-net -u "$user" --passwd-on-stdin sslvpn.ethz.ch &
sleep 4
if [ $(pgrep -c openconnect) -eq 1 ]; then
notify-send "ETH VPN" "ETH VPN connected" #implement an actual check here
fi
else
sudo pkill openconnect && notify-send "ETH VPN" "ETH VPN disconnected"
fi