mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-17 01:48:16 +01:00
17 lines
426 B
Plaintext
17 lines
426 B
Plaintext
#!/usr/bin/with-contenv bash
|
|
|
|
port="8080"
|
|
host="localhost"
|
|
timeout="30"
|
|
timeout_argument=""
|
|
|
|
if timeout -t 1337 true >/dev/null 2>&1; then
|
|
timeout_argument="-t"
|
|
fi
|
|
|
|
timeout ${timeout_argument} "${timeout}" \
|
|
bash -c \
|
|
"until echo > /dev/tcp/${host}/${port} ; do sleep 0.5; done" \
|
|
>/dev/null 2>&1 && bash -c "scrutiny-collector-metrics run" || echo "port $port is not available" && "s6-svscanctl -t /var/run/s6/services"
|
|
|