mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-25 17:54:11 +02:00
healthcheck testing
This commit is contained in:
@@ -2,14 +2,19 @@
|
|||||||
|
|
||||||
# Script checks health of running container
|
# 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
|
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
|
exit 0
|
||||||
else
|
|
||||||
if [ "ps -fe|grep "[i]obroker.js-controller"|awk '{print $2}'" != "" ]
|
|
||||||
then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo 'Health status: !!! NOT OK !!! - Something went wrong. Please see Container Logs for more details.'
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user