From 561e6cf130e579a427b17efbcd8ad2cc5b7fa278 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 17 Apr 2023 02:12:42 +0200 Subject: [PATCH] Alternative sleep function --- run/power.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/run/power.sh b/run/power.sh index 4fc7b72..81efb6a 100644 --- a/run/power.sh +++ b/run/power.sh @@ -12,7 +12,6 @@ _QEMU_SHUTDOWN_COUNTER=/run/qemu.counter rm -f "${_QEMU_PID}" rm -f "${_QEMU_SHUTDOWN_COUNTER}" -# Allows for troubleshooting signals sent to the process _trap(){ func="$1" ; shift for sig ; do @@ -20,6 +19,13 @@ _trap(){ done } +snore() +{ + local IFS + [[ -n "${_snore_fd:-}" ]] || exec {_snore_fd}<> <(:) + read ${1:+-t "$1"} -u $_snore_fd || : +} + _graceful_shutdown(){ local QEMU_MONPORT="${QEMU_MONPORT:-7100}"