dotfiles/.local/bin/tools/ethvpn

13 lines
428 B
Bash
Executable File

#!/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