mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-15 17:08:19 +01:00
21 lines
469 B
Plaintext
21 lines
469 B
Plaintext
#!/usr/bin/with-contenv bashio
|
|
|
|
START_TIME="$(date +%s)"
|
|
|
|
echo "Waiting for first healthcheck execution (max $FIRST_HEALTHCHECK_TIMEOUT seconds)..."
|
|
|
|
while [ ! -f "/tmp/healthcheck-signal" ];
|
|
do
|
|
sleep 1
|
|
|
|
ELAPSED_TIME="$(expr \date +%s\ - $START_TIME)"
|
|
|
|
if [ $ELAPSED_TIME -gt $FIRST_HEALTHCHECK_TIMEOUT ]
|
|
then
|
|
echo "Signal from healthcheck not received in time, failing the execution..."
|
|
exit 20
|
|
fi
|
|
done
|
|
|
|
echo "Signal from healthcheck received"
|
|
exit 0 |