Update power.sh

This commit is contained in:
Kroese 2024-05-26 12:31:51 +02:00 committed by GitHub
parent a3aaeb9cd4
commit 098c6b84fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,19 +29,22 @@ boot() {
if [ -s "$QEMU_PTY" ]; then if [ -s "$QEMU_PTY" ]; then
if [ "$(stat -c%s "$QEMU_PTY")" -gt 7 ]; then if [ "$(stat -c%s "$QEMU_PTY")" -gt 7 ]; then
local fail=""
if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then if [[ "${BOOT_MODE,,}" == "windows_legacy" ]]; then
grep -Fq "No bootable device." "$QEMU_PTY" && finish 33 && return 0 grep -Fq "No bootable device." "$QEMU_PTY" && fail="y"
grep -Fq "BOOTMGR is missing" "$QEMU_PTY" && finish 33 && return 0 grep -Fq "BOOTMGR is missing" "$QEMU_PTY" && fail="y"
fi fi
if [ -z "$fail" ]; then
info "Windows started succesfully, visit http://localhost:8006/ to view the screen..." info "Windows started succesfully, visit http://localhost:8006/ to view the screen..."
return 0 return 0
fi fi
fi fi
fi
error "Timeout while waiting for QEMU to boot the machine!" error "Timeout while waiting for QEMU to boot the machine!"
finish 33 finish 33
return 0 exit 33
} }
ready() { ready() {