#!/bin/sh cd "$(dirname "$0")/.." limit="${1:-120}" end=$(( $(date +%s) + limit )) while [ "$(date +%s)" -lt "$end" ]; do if [ "$(curl -s -o /dev/null -w '%{http_code}' localhost:8080/health/ready)" = 200 ] \ && python3 scripts/upload_tools.py roundtrip >/dev/null 2>&1; then echo "ready"; exit 0 fi sleep 2 done echo "NOT READY after ${limit}s"; exit 1