healthcheck testing

This commit is contained in:
buanet
2020-07-27 23:11:05 +02:00
parent f5f7e3f1ec
commit a78610eb68

View File

@@ -2,14 +2,19 @@
# Script checks health of running container
if [ "$(cat /opt/iobroker/.docker_config/.healthcheck)" == "starting" ] || [ "$(cat /opt/iobroker/.docker_config/.healthcheck)" == "maintenance" ]
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
else
if [ "ps -fe|grep "[i]obroker.js-controller"|awk '{print $2}'" != "" ]
then
exit 0
fi
fi
echo 'Health status: !!! NOT OK !!! - Something went wrong. Please see Container Logs for more details.'
exit 1