Update power.sh

This commit is contained in:
Kroese 2024-02-06 00:31:22 +01:00 committed by GitHub
parent 554dd91f7f
commit 9a9832f57b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -137,18 +137,18 @@ _graceful_shutdown() {
finish "$code" && return "$code"
fi
local abort="Cannot send ACPI signal during Windows setup, aborting..."
if [ -f "$QEMU_PTY" ] && [ ! -f "$STORAGE/windows.boot" ]; then
if [ ! -f "$STORAGE/windows.old" ]; then
if ! grep -Fq "$BOOT_LINE" "$QEMU_PTY"; then
info "Cannot send ACPI signal during Windows setup, aborting..."
finish "$code" && return "$code"
info "$abort" && finish "$code" && return "$code"
fi
else
local last
last=$(tail -n 1 "$QEMU_PTY")
if [[ "${last,,}" != "${BIOS_LINE,,}" ]]; then
info "Cannot send ACPI signal during Windows setup, aborting..."
finish "$code" && return "$code"
info "$abort" && finish "$code" && return "$code"
fi
fi
fi