diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-02 15:19:25 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-08-02 15:19:25 +0200 |
commit | 9b791ac8786eed2d242d0909dd2379f008952042 (patch) | |
tree | 403c08eb322e18d045606822911a7eb6036f0070 /bin/extra | |
parent | e614a330978ce7e7f6d130cc7d199150e16a409d (diff) | |
parent | 63c64f071ecd45cf66ab49d199a634cd8db27056 (diff) |
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/extra')
-rwxr-xr-x | bin/extra/aivpn | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/bin/extra/aivpn b/bin/extra/aivpn new file mode 100755 index 0000000..c67aa2c --- /dev/null +++ b/bin/extra/aivpn @@ -0,0 +1,39 @@ +#!/bin/sh + +die () +{ + echo "$@" >&2 +} + +if [ "$1" = "-k" ] +then + pgrep -f -- "ssh.*-L.*mc-wd" | + xargs kill + exit +fi + +# For when script calls itself +if [ -n "$PASSWORD" ] +then + pass show "$PASSWORD" && + exit + exit 1 +fi + +keyadd ehb/ai + +export SSH_ASKPASS="$0" +export SSH_ASKPASS_REQUIRE="prefer" +export PASSWORD=aluc + +die "I: Activating vpn" +ssh mc-wd rasdial "vpn.student.ehb.be" +ssh -f -N \ + -L 2222:10.2.160.41:22 \ + mc-wd + +ssh -t \ + -L 8188:localhost:8188 \ + mc-wd \ + ssh -N -L 8188:localhost:8188 luca@10.2.160.41 +die "[8188], [2222]" |