From 33efef91edcac4976b880677fc0f5cf9fca67a59 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 22 Mar 2023 11:46:58 -0300 Subject: tests/vm-check.sh: Still shutdown if "check.sh" fails when -x is given --- tests/vm-check.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/vm-check.sh') diff --git a/tests/vm-check.sh b/tests/vm-check.sh index 5b50ec7..ddae0e2 100755 --- a/tests/vm-check.sh +++ b/tests/vm-check.sh @@ -80,11 +80,14 @@ if [ "$SHUTDOWN" = true ]; then vm down "$HOST" fi +shutdown() { + if [ "$SHUTDOWN" = true ]; then + vm down "$HOST" + fi +} +trap shutdown EXIT + vm up "$HOST" untill -m5 -n5 ssh "$HOST" uptime scp tests/checks/"$TYPE".sh "$HOST":check.sh ssh "$HOST" sh check.sh "$REMOTE" - -if [ "$SHUTDOWN" = true ]; then - vm down "$HOST" -fi -- cgit v1.2.3