From 7790f81d150fe5cd1029884bfa59d9d0a363d969 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 23 Jan 2024 18:46:47 +0100 Subject: [PATCH] fix: Trap exit code (#592) --- src/power.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/power.sh b/src/power.sh index 25f6576..af99b25 100644 --- a/src/power.sh +++ b/src/power.sh @@ -98,7 +98,6 @@ terminal() { _graceful_shutdown() { - local cnt=0 local code=$? local pid url response @@ -144,6 +143,8 @@ _graceful_shutdown() { fi + local cnt=0 + while [ "$cnt" -lt "$QEMU_TIMEOUT" ]; do ! isAlive "$pid" && break