mirror of
https://github.com/AuxXxilium/arv-v-dsm.git
synced 2024-11-23 23:10:58 +07:00
23 lines
312 B
Bash
23 lines
312 B
Bash
#!/usr/bin/env bash
|
|
set -u
|
|
|
|
# Docker Healthcheck
|
|
|
|
PORT=5000
|
|
FILE="/var/dsm.ip"
|
|
|
|
if [ ! -f "${FILE}" ]; then
|
|
echo "IP not assigned"
|
|
exit 1
|
|
fi
|
|
|
|
IP=$(cat "${FILE}")
|
|
|
|
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
|