2025-06-19 14:20:03 +08:00
|
|
|
#!/usr/bin/env bash
|
2020-05-03 19:51:30 +08:00
|
|
|
set -eo pipefail
|
|
|
|
|
2022-01-21 01:01:00 +08:00
|
|
|
. scripts/grafana-server/variables
|
2020-05-03 19:51:30 +08:00
|
|
|
|
|
|
|
HOST=${HOST:-$DEFAULT_HOST}
|
|
|
|
PORT=${PORT:-$DEFAULT_PORT}
|
|
|
|
|
2025-07-18 01:18:29 +08:00
|
|
|
printf "Waiting for grafana-server to finish starting, host=%s, port=%s" "$HOST" "$PORT"
|
2020-05-03 19:51:30 +08:00
|
|
|
|
2025-07-18 01:18:29 +08:00
|
|
|
timeout=60
|
|
|
|
elapsed=0
|
|
|
|
|
|
|
|
while ! curl -s -f http://$HOST:$PORT/health > /dev/null 2>&1; do
|
|
|
|
if [ $elapsed -ge $timeout ]; then
|
|
|
|
printf "\nTimeout after %d seconds waiting for grafana-server to start\n" "$timeout"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf "."
|
|
|
|
sleep 1
|
|
|
|
elapsed=$((elapsed + 1))
|
|
|
|
done
|
|
|
|
|
|
|
|
printf "\n"
|