Files
ioBroker.docker/amd64/scripts/healthcheck.sh
2020-07-27 23:11:05 +02:00

21 lines
641 B
Bash

#!/bin/bash
# Script checks health of running container
if [ "$(cat /opt/iobroker/.docker_config/.healthcheck)" == "starting" ]
then
echo 'Health status: OK - Startup script is still running.'
exit 0
elif [ "$(cat /opt/iobroker/.docker_config/.healthcheck)" == "maintenance" ]
then
echo 'Health status: OK - Container running in maintenance mode.'
exit 0
elif [ "$(ps -fe|grep "[i]obroker.js-controller"|awk '{print $2}')" != "" ]
then
echo 'Health status: OK - Main process (js-controller) is running.'
exit 0
fi
echo 'Health status: !!! NOT OK !!! - Something went wrong. Please see Container Logs for more details.'
exit 1