arv-v-dsm/run/check.sh
2023-04-22 20:29:41 +02:00

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