improved uni vpn script

This commit is contained in:
Alexander Bocken 2020-08-17 19:29:27 +02:00
parent 7f476e0d77
commit e137cdb813
2 changed files with 14 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[FileDialog]
history=file:///home/alex, file:///home/alex/eth/thermo2, file:///home/alex/eth/wuf2, file:///home/alex/eth/innoproz, file:///home/alex/bks/Magazines/Death to the World
lastVisited=file:///home/alex/bks/Magazines/Death to the World
history=file:///home/alex, file:///home/alex/eth/thermo2, file:///home/alex/eth/wuf2, file:///home/alex/eth/innoproz, file:///home/alex/bks/Magazines/Death to the World, file:///home/alex/eth/fluid1
lastVisited=file:///home/alex/eth/fluid1
qtVersion=5.15.0
shortcuts=file:, file:///home/alex
sidebarWidth=82

View File

@ -1,2 +1,12 @@
#!/bin/bash
[ $( pgrep -c openconnect ) -eq 0 ] &&( dmenupass "Password for ETH-VPN:" | sudo openconnect -g student-net -u abocken@student-net.ethz.ch --passwd-on-stdin sslvpn.ethz.ch ) || ( sudo pkill openconnect; notify-send "ETH VPN" "ETH VPN disconnected")
#!/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