mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 13:24:04 +02:00
test
This commit is contained in:
7
portainer_agent/rootfs/usr/sbin/healthcheck
Normal file
7
portainer_agent/rootfs/usr/sbin/healthcheck
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
if [ -f "/tmp/healthcheck-signal" ]; then
|
||||
curl -k --fail https://127.0.0.1:9001/ping || exit 1
|
||||
else
|
||||
touch /tmp/healthcheck-signal
|
||||
fi
|
||||
21
portainer_agent/rootfs/usr/sbin/wait-for-signal
Normal file
21
portainer_agent/rootfs/usr/sbin/wait-for-signal
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user