summaryrefslogtreecommitdiff
path: root/bin/extra/aivpn
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-02-29 14:26:50 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-02-29 14:26:50 +0100
commitc16799693cb6d780f258833689a6d312506093bb (patch)
treef11e3ba72e632269160275f1c3c36d170fb81a62 /bin/extra/aivpn
parentda998b5c857aef8903bf791b4e41966cf230562c (diff)
parent8ab76a9ebf8414c720f13bd0aaaa2e6452ff753b (diff)
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'bin/extra/aivpn')
-rwxr-xr-xbin/extra/aivpn17
1 files changed, 4 insertions, 13 deletions
diff --git a/bin/extra/aivpn b/bin/extra/aivpn
index 3c87ce8..aab90a8 100755
--- a/bin/extra/aivpn
+++ b/bin/extra/aivpn
@@ -4,27 +4,18 @@ logn() { printf "%s\n" "$@"; }
if [ "$1" = "-k" ]
then
- pgrep -f -- "ssh.*-L.*vm" |
- xargs kill
+ pgrep -f -- "ssh.*-L.*vm" | xargs kill
exit
fi
-# For when script calls itself
-if [ "$PASSWORD" ]
-then
- pass show "$PASSWORD" &&
- exit
- exit 1
-fi
-
keyadd ehb/ai
-export SSH_ASKPASS="$0"
+export SSH_ASKPASS="sshpass"
export SSH_ASKPASS_REQUIRE="prefer"
-export PASSWORD=zot/qemu
+export PASSWORD="zot/qemu"
logn "I: Waiting for connectivity..."
-while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep -q "Permission denied"
+while ! ssh -o ConnectTimeout=1 -o BatchMode=yes vm 2>&1 | grep "Permission denied" > /dev/null
do sleep 1
done