major springcleaning

This commit is contained in:
2023-10-12 15:12:12 +02:00
parent 648a010f64
commit 98b48cb97b
332 changed files with 6708 additions and 10208 deletions

View File

@ -8,12 +8,16 @@ choice="$(ls "${XDG_CONFIG_HOME}/openvpn/cfgs" | sed 's/\.ovpn//' | awk 'BEGIN {
[ -z "$choice" ] && exit
if [ "$choice" = "ETH" ]; then
if [ $(pgrep -c openconnect) -eq 0 ]; then
transmission-remote -u 0
transmission-remote -d 0
pass "$ETH_password_path" | sudo openconnect -g student-net -u "$ETH_user" --passwd-on-stdin sslvpn.ethz.ch &
if ping -c 3 -W 3 -q webprint.ethz.ch ;then
notify-send "ETH VPN" "ETH VPN connected"
fi
elif ping -c 1 -W 2 -q webprint.ethz.ch ;then
if ping -c 3 -W 3 -q webprint.ethz.ch ;then
notify-send "ETH VPN" "ETH VPN connected"
fi
elif ping -c 1 -W 2 -q webprint.ethz.ch ;then
sudo pkill openconnect && notify-send "ETH VPN" "ETH VPN disconnected"
transmission-remote -U
transmission-remote -D
fi
else
printf '%s\n%s\n' "$USER" "$(pass $PASS_DIR)" > /tmp/tmp_pass