summaryrefslogtreecommitdiff
path: root/bin/extra
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-02-28 10:33:54 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-02-28 10:33:54 +0100
commit9a145601b331c0077d183e2b8f39c8f69450b452 (patch)
tree905174bc3618b47a3b93f47e053af936bcd0f0a8 /bin/extra
parenta845f02e612696547fe2981bc987674e8058b419 (diff)
use sshpass and refactor
Diffstat (limited to 'bin/extra')
-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