mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 11:25:49 +00:00
Update power.sh
This commit is contained in:
parent
ed587a0539
commit
7031f66c13
1 changed files with 12 additions and 7 deletions
19
src/power.sh
19
src/power.sh
|
|
@ -116,17 +116,17 @@ _graceful_shutdown() {
|
||||||
finish "$code" && return "$code"
|
finish "$code" && return "$code"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$QEMU_PTY" ]; then
|
local remove_iso=""
|
||||||
if ! grep -Fq "Windows Boot Manager" "$QEMU_PTY"; then
|
|
||||||
if [ ! -f "$STORAGE/windows.bios" ]; then
|
if [ ! -f "$STORAGE/windows.bios" ]; then
|
||||||
|
if [ ! -f "$STORAGE/windows.boot" ] && [ -f "$QEMU_PTY" ]; then
|
||||||
|
if grep -Fq "Windows Boot Manager" "$QEMU_PTY"; then
|
||||||
|
remove_iso="y"
|
||||||
|
else
|
||||||
info "Cannot send ACPI signal during Windows setup, aborting..."
|
info "Cannot send ACPI signal during Windows setup, aborting..."
|
||||||
finish "$code" && return "$code"
|
finish "$code" && return "$code"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -f "$STORAGE/$BASE" ] && [ ! -f "$STORAGE/windows.bios" ]; then
|
|
||||||
rm -f "$STORAGE/$BASE"
|
|
||||||
touch "$STORAGE/windows.boot"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Send ACPI shutdown signal
|
# Send ACPI shutdown signal
|
||||||
|
|
@ -151,6 +151,11 @@ _graceful_shutdown() {
|
||||||
|
|
||||||
if [ "$cnt" -ge "$QEMU_TIMEOUT" ]; then
|
if [ "$cnt" -ge "$QEMU_TIMEOUT" ]; then
|
||||||
error "Shutdown timeout reached, aborting..."
|
error "Shutdown timeout reached, aborting..."
|
||||||
|
else
|
||||||
|
if [ -f "$STORAGE/$BASE" ] && [ -n "$remove_iso" ]; then
|
||||||
|
rm -f "$STORAGE/$BASE"
|
||||||
|
touch "$STORAGE/windows.boot"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
finish "$code" && return "$code"
|
finish "$code" && return "$code"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue