From 443e3a86ad2a99e4926a373891d7edeedad7db97 Mon Sep 17 00:00:00 2001 From: Georg Sauthoff Date: Sun, 22 Dec 2024 17:44:32 +0100 Subject: [PATCH] wait for remote closing connection --- test/unlock.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test/unlock.sh b/test/unlock.sh index 2adf1b2..7d7dfd9 100755 --- a/test/unlock.sh +++ b/test/unlock.sh @@ -15,7 +15,12 @@ if [ "$n" -ne 1 ]; then exit 1 fi -$ssh root@"$guest" systemd-tty-ask-password-agent < pw.log - - - +set +e +timeout 30 $ssh root@"$guest" 'systemd-tty-ask-password-agent; sleep 60' < pw.log +r=$? +set -e +if [ $r = 124 ]; then + echo 'Unlock timed out' >&2 + exit 1 +fi +exit 0