mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
Healthcheck
This commit is contained in:
parent
f6139a75ad
commit
041735694f
16
run/check.sh
16
run/check.sh
@ -4,15 +4,19 @@ set -eu
|
|||||||
# Docker Healthcheck
|
# Docker Healthcheck
|
||||||
|
|
||||||
PORT=5000
|
PORT=5000
|
||||||
IP="20.20.20.21"
|
|
||||||
|
|
||||||
FILE="/var/dsm.ip"
|
FILE="/var/dsm.ip"
|
||||||
[ -f "$FILE" ] && IP=$(cat "${FILE}")
|
|
||||||
|
|
||||||
if ! curl -m 3 -ILfSs "http://$IP:$PORT/"; then
|
if [ ! -f "${FILE}" ]; then
|
||||||
echo "Failed to reach $IP"
|
echo "IP not assigned"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Healthcheck OK for $IP"
|
IP=$(cat "${FILE}")
|
||||||
|
|
||||||
|
if ! curl -m 3 -ILfSs "http://${IP}:${PORT}/"; then
|
||||||
|
echo "Failed to reach ${IP}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Healthcheck OK for ${IP}"
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user