diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-05-03 18:22:38 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-05-03 18:22:38 +0200 |
commit | 80462e764abf047544be6026c5d67c1f54599ae5 (patch) | |
tree | 0c018ce1a0b0b5d186eb9db5881c99271c8f3745 /bin/extra/aivpn | |
parent | 4cf668d9a23e39fbc8a215cc7876f95291722366 (diff) |
Update
Diffstat (limited to 'bin/extra/aivpn')
-rwxr-xr-x | bin/extra/aivpn | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bin/extra/aivpn b/bin/extra/aivpn index 6fa0783..21436ed 100755 --- a/bin/extra/aivpn +++ b/bin/extra/aivpn @@ -1,6 +1,6 @@ #!/bin/sh -logn() { printf "%s\n" "$@"; } +err() { printf "%s\n" "$@"; } if [ "$1" = "-k" ] then @@ -8,23 +8,25 @@ then exit fi -keyadd ehb/ai +err "I: Waiting for connectivity..." +while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep "Permission denied" > /dev/null +do sleep 1 +done + export SSH_ASKPASS="sshpass" export SSH_ASKPASS_REQUIRE="prefer" export PASSWORD="zot/qemu" -logn "I: Waiting for connectivity..." -while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep "Permission denied" > /dev/null -do sleep 1 -done - -logn "I: Activating vpn" +err "I: Activating vpn" ssh vm "rasdial \"vpn.student.ehb.be\"" + +keyadd ehb/ai ssh -f -N \ -L 2222:10.2.160.41:22 \ vm +keyadd ehb/vm_int ssh -f -N \ -L 2223:10.2.160.9:22 \ vm |