From 18549215825a9933e0bc27314eea6f4ec790c6b7 Mon Sep 17 00:00:00 2001 From: Kroese Date: Sun, 26 May 2024 12:10:24 +0200 Subject: [PATCH] Update power.sh --- src/power.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/power.sh b/src/power.sh index 3b61825..421da53 100644 --- a/src/power.sh +++ b/src/power.sh @@ -49,18 +49,14 @@ ready() { local last local bios="Booting from Hard" last=$(grep "^Booting.*" "$QEMU_PTY" | tail -1) - if [[ "${last,,}" == "${bios,,}"* ]]; then - if ! grep -Fq "BOOTMGR is missing" "$QEMU_PTY"; then - return 0 - fi - fi - return 1 + [[ "${last,,}" != "${bios,,}"* ]] && return 1 + grep -Fq "No bootable device." "$QEMU_PTY" && return 1 + grep -Fq "BOOTMGR is missing" "$QEMU_PTY" && return 1 + return 0 fi local line="\"Windows Boot Manager\"" - if grep -Fq "$line" "$QEMU_PTY"; then - return 0 - fi + grep -Fq "$line" "$QEMU_PTY" && return 0 return 1 }