mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 03:15:49 +00:00
Update power.sh
This commit is contained in:
parent
bc1e85f244
commit
2278184fd8
1 changed files with 5 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ QEMU_LOG="/run/shm/qemu.log"
|
|||
QEMU_OUT="/run/shm/qemu.out"
|
||||
QEMU_END="/run/shm/qemu.end"
|
||||
|
||||
rm -f /run/shm/qemu.*
|
||||
touch "$QEMU_LOG"
|
||||
|
||||
_trap() {
|
||||
|
|
@ -38,6 +39,9 @@ finish() {
|
|||
done
|
||||
fi
|
||||
|
||||
pid="/var/run/tpm.pid"
|
||||
[ -f "$pid" ] && pKill "$(<"$pid")"
|
||||
|
||||
closeNetwork
|
||||
|
||||
sleep 1
|
||||
|
|
@ -87,7 +91,6 @@ terminal() {
|
|||
_graceful_shutdown() {
|
||||
|
||||
local code=$?
|
||||
local pid url response
|
||||
|
||||
set +e
|
||||
|
||||
|
|
@ -104,6 +107,7 @@ _graceful_shutdown() {
|
|||
finish "$code" && return "$code"
|
||||
fi
|
||||
|
||||
local pid=""
|
||||
pid=$(<"$QEMU_PID")
|
||||
|
||||
if ! isAlive "$pid"; then
|
||||
|
|
@ -115,7 +119,6 @@ _graceful_shutdown() {
|
|||
echo 'system_powerdown' | nc -q 1 -w 1 localhost "${QEMU_PORT}" > /dev/null
|
||||
|
||||
local cnt=0
|
||||
|
||||
while [ "$cnt" -lt "$QEMU_TIMEOUT" ]; do
|
||||
|
||||
sleep 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue