feat: Improve shutdown (#448)

* feat: Improve shutdown
This commit is contained in:
Kroese
2023-12-10 09:22:35 +01:00
committed by GitHub
parent 03d2665725
commit b9f3e52ba4
6 changed files with 19 additions and 10 deletions

View File

@@ -5,12 +5,12 @@ set -Eeuo pipefail
[ -f "/run/qemu.count" ] && echo "QEMU is shutting down.." && exit 1
file="/run/dsm.url"
url="http://127.0.0.1:2210/read?command=10"
if [ ! -f "$file" ]; then
# Retrieve IP from guest VM for Docker healthcheck
{ json=$(curl -m 30 -sk http://127.0.0.1:2210/read?command=10); rc=$?; } || :
{ json=$(curl -m 20 -sk "$url"); rc=$?; } || :
(( rc != 0 )) && echo "Failed to connect to guest: curl error $rc" && exit 1
{ result=$(echo "$json" | jq -r '.status'); rc=$?; } || :