summaryrefslogtreecommitdiff
path: root/bin/extra/aivpn
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-15 00:33:26 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-10-15 00:33:26 +0200
commit826ce094fecc4c6e07faf6e8b91387c2ae49842c (patch)
tree1820c843e4e260f6b51e8d269a972295a17e558c /bin/extra/aivpn
parentc032a9d071ee4b7eb2bfe79ec03d2a7dc4020f15 (diff)
parenta915b5ade1a47b9678e2f9963b13b49dbd406031 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/extra/aivpn')
-rwxr-xr-xbin/extra/aivpn15
1 files changed, 10 insertions, 5 deletions
diff --git a/bin/extra/aivpn b/bin/extra/aivpn
index 55e013a..fd72ffb 100755
--- a/bin/extra/aivpn
+++ b/bin/extra/aivpn
@@ -4,7 +4,7 @@ logn() { printf "%s\n" "$@"; }
if [ "$1" = "-k" ]
then
- pgrep -f -- "ssh.*-L.*mc-wd" |
+ pgrep -f -- "ssh.*-L.*vm" |
xargs kill
exit
fi
@@ -21,16 +21,21 @@ keyadd ehb/ai
export SSH_ASKPASS="$0"
export SSH_ASKPASS_REQUIRE="prefer"
-export PASSWORD=aluc
+export PASSWORD=zot/qemu
+
+logn "I: Waiting for connectivity..."
+while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep -q "Permission denied"
+do sleep 1
+done
logn "I: Activating vpn"
-# ssh mc-wd "rasdial \"vpn.student.ehb.be\" \"luca.raymaekers@student.ehb.be\" \"$(pass school/login.ehb.be)\""
+ssh vm "rasdial \"vpn.student.ehb.be\""
ssh -f -N \
-L 2222:10.2.160.41:22 \
- mc-wd
+ vm
ssh -t \
-L 8188:localhost:8188 \
- mc-wd \
+ vm \
ssh -N -L 8188:localhost:8188 luca@10.2.160.41
logn "[8188], [2222]"