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 &
|
2020-08-23 17:15:47 +02:00
|
|
|
if ping -c 4 -W 6 -q webprint.ethz.ch ;then
|
|
|
|
notify-send "ETH VPN" "ETH VPN connected"
|
2020-08-17 19:29:27 +02:00
|
|
|
fi
|
|
|
|
else
|
2020-08-23 17:15:47 +02:00
|
|
|
if ping -c 1 -W 2 -q webprint.ethz.ch ;then
|
|
|
|
sudo pkill openconnect && notify-send "ETH VPN" "ETH VPN disconnected"
|
|
|
|
fi
|
2020-08-17 19:29:27 +02:00
|
|
|
fi
|