Sync
This commit is contained in:
parent
62416089f5
commit
fb9b659142
1 changed files with 4 additions and 6 deletions
10
run/power.sh
10
run/power.sh
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue