#!/bin/sh set -eu manifest=http://127.0.0.1:5480/api/knowledge for attempt in $(seq 1 240); do body=$(curl -fsS "$manifest" 2>/dev/null || true) missing="" for file in ip2asn.bin networks.bin carriers.json registry.bin; do case "$body" in *"\"$file\""*) ;; *) missing="$missing $file" ;; esac done case "$body" in *'"format":2,'*) ;; *) missing="$missing format-2" ;; esac if [ -n "$body" ] && [ -z "$missing" ]; then echo "network data ready: $(printf '%s' "$body" | head -c 200)" exit 0 fi sleep 10 done echo "::warning::the server's network data still lacks${missing:- everything} after forty minutes; the apps embed what it has"