This commit is contained in:
Kroese 2023-04-29 03:05:05 +02:00 committed by GitHub
parent 62416089f5
commit fb9b659142

View file

@ -21,13 +21,12 @@ _trap(){
_graceful_shutdown() { _graceful_shutdown() {
set +e
[ ! -f "${_QEMU_PID}" ] && return [ ! -f "${_QEMU_PID}" ] && return
[ -f "${_QEMU_SHUTDOWN_COUNTER}" ] && return [ -f "${_QEMU_SHUTDOWN_COUNTER}" ] && return
set +e echo && echo "Received $1 signal, shutting down..."
echo
echo "Received $1 signal, shutting down..."
echo 0 > "${_QEMU_SHUTDOWN_COUNTER}" echo 0 > "${_QEMU_SHUTDOWN_COUNTER}"
# Send the shutdown (system_powerdown) command to the QMP monitor # Send the shutdown (system_powerdown) command to the QMP monitor
@ -48,8 +47,7 @@ _graceful_shutdown() {
done done
echo echo && echo "Quitting..."
echo "Quitting..."
echo 'quit' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null || true echo 'quit' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null || true
return return