Update power.sh

This commit is contained in:
Kroese 2024-05-27 12:59:14 +02:00 committed by GitHub
parent 38562ce187
commit 4e255e903e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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