virtual-dsm/run/check.sh
2023-04-22 17:00:13 +02:00

22 lines
273 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
exit 1
fi
echo "Healthcheck OK"
exit 0