mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-17 10:29:00 +02:00
21 lines
670 B
Bash
21 lines
670 B
Bash
#!/usr/bin/env bash
|
|
|
|
# Script checks health of running container
|
|
|
|
if [ "$(cat /opt/.docker_config/.healthcheck)" == "starting" ]
|
|
then
|
|
echo "Health status: OK - Startup script is still running."
|
|
exit 0
|
|
elif [ "$(cat /opt/.docker_config/.healthcheck)" == "maintenance" ]
|
|
then
|
|
echo "Health status: OK - Container is 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 and/or try restarting the container."
|
|
exit 1
|