mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-09 09:57:32 +08:00
18 lines
453 B
Bash
18 lines
453 B
Bash
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
|
|
[ ! -f "/run/qemu.pid" ] && echo "QEMU not running yet.." && exit 0
|
|
[ -f "/run/qemu.count" ] && echo "QEMU is shutting down.." && exit 1
|
|
|
|
file="/run/dsm.url"
|
|
[ ! -f "$file" ] && echo "DSM has not enabled networking yet.." && exit 1
|
|
|
|
location=$(cat "$file")
|
|
|
|
if ! curl -m 20 -ILfSs "http://$location/" > /dev/null; then
|
|
echo "Failed to reach page at http://$location" && exit 1
|
|
fi
|
|
|
|
echo "Healthcheck OK"
|
|
exit 0
|