diff --git a/src/power.sh b/src/power.sh index 1ce6232..ecc65ff 100644 --- a/src/power.sh +++ b/src/power.sh @@ -35,6 +35,11 @@ boot() { fi error "Timeout while waiting for QEMU to boot the machine!" + + local pid + pid=$(<"$QEMU_PID") + { kill -15 "$pid" || true; } 2>/dev/null + return 0 } @@ -44,9 +49,7 @@ ready() { [ ! -s "$QEMU_PTY" ] && return 1 local line="\"Windows Boot Manager\"" - if grep -Fq "$line" "$QEMU_PTY"; then - return 0 - fi + grep -Fq "$line" "$QEMU_PTY" && return 0 return 1 }