mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 21:40:01 +08:00
23 lines
307 B
Bash
23 lines
307 B
Bash
#!/usr/bin/env bash
|
|
set -u
|
|
|
|
# Docker Healthcheck
|
|
|
|
: ${DHCP:='N'}
|
|
|
|
if [ "$DHCP" = "Y" ]; then
|
|
PORT=5555
|
|
IP="127.0.0.1"
|
|
else
|
|
PORT=5000
|
|
IP="20.20.20.21"
|
|
fi
|
|
|
|
if ! curl -m 3 -ILfSs "http://${IP}:${PORT}/" > /dev/null; then
|
|
echo "Failed to reach ${IP}:${PORT}"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Healthcheck OK"
|
|
exit 0
|