added status output to ethvpn
This commit is contained in:
parent
e7db5a5ee3
commit
b01ee492db
@ -1,13 +1,18 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
user="abocken@student-net.ethz.ch"
|
user="abocken@student-net.ethz.ch"
|
||||||
password_path="ETH/VPN"
|
password_path="ETH/VPN"
|
||||||
if [ $(pgrep -c openconnect) -eq 0 ]; then
|
if [ "$1" = "status" ]; then
|
||||||
pass "$password_path" | sudo openconnect -g student-net -u "$user" --passwd-on-stdin sslvpn.ethz.ch &
|
ping -c 2 -q webprint.ethz.ch > /dev/null && printf '🔬'
|
||||||
if ping -c 4 -W 6 -q webprint.ethz.ch ;then
|
printf '\n'
|
||||||
notify-send "ETH VPN" "ETH VPN connected"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
if ping -c 1 -W 2 -q webprint.ethz.ch ;then
|
if [ $(pgrep -c openconnect) -eq 0 ]; then
|
||||||
sudo pkill openconnect && notify-send "ETH VPN" "ETH VPN disconnected"
|
pass "$password_path" | sudo openconnect -g student-net -u "$user" --passwd-on-stdin sslvpn.ethz.ch &
|
||||||
|
if ping -c 4 -W 6 -q webprint.ethz.ch ;then
|
||||||
|
notify-send "ETH VPN" "ETH VPN connected"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if ping -c 1 -W 2 -q webprint.ethz.ch ;then
|
||||||
|
sudo pkill openconnect && notify-send "ETH VPN" "ETH VPN disconnected"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user