mirror of
https://github.com/AuxXxilium/arv-v-dsm.git
synced 2024-11-23 23:10:58 +07:00
fix: Shutdown loop (#474)
This commit is contained in:
parent
fd19c7b4f3
commit
ef5b650991
20
src/power.sh
20
src/power.sh
@ -53,20 +53,16 @@ _graceful_shutdown() {
|
||||
while [ "$(cat $QEMU_COUNT)" -lt "$QEMU_TIMEOUT" ]; do
|
||||
|
||||
# Try to connect to qemu
|
||||
if echo 'info version'| nc -q 1 -w 1 localhost "$QEMU_PORT" >/dev/null 2>&1 ; then
|
||||
|
||||
sleep 1
|
||||
|
||||
# Increase the counter
|
||||
cnt=$(($(cat $QEMU_COUNT)+1))
|
||||
echo $cnt > "$QEMU_COUNT"
|
||||
|
||||
[[ "$DEBUG" == [Yy1]* ]] && info "Shutting down, waiting... ($cnt/$QEMU_TIMEOUT)"
|
||||
|
||||
else
|
||||
break
|
||||
if ! echo 'info version'| nc -q 1 -w 1 localhost "$QEMU_PORT" >/dev/null 2>&1 ; then
|
||||
break
|
||||
fi
|
||||
|
||||
# Increase the counter
|
||||
cnt=$(($(cat $QEMU_COUNT)+1))
|
||||
echo $cnt > "$QEMU_COUNT"
|
||||
|
||||
[[ "$DEBUG" == [Yy1]* ]] && info "Shutting down, waiting... ($cnt/$QEMU_TIMEOUT)"
|
||||
|
||||
done
|
||||
|
||||
if [ "$(cat $QEMU_COUNT)" -ge "$QEMU_TIMEOUT" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user