#!/usr/bin/env bash
set -euo pipefail

echo "== Network reachability =="

: "${CHECK_URLS:=}"

if [[ -z "${CHECK_URLS}" ]]; then
  cat <<'TXT'
No URLs configured.

Set CHECK_URLS to a space-separated list of HTTPS URLs you want to test, e.g.:
  CHECK_URLS="https://github.com https://example.com" ./oss_llm/quick_checks.sh

This script intentionally does not hardcode any provider endpoints.
TXT
else
  for url in ${CHECK_URLS}; do
    echo "\n--- $url"
    curl -I --max-time 10 "$url" | head -n 5 || true
  done
fi

echo "\n== Proxy env vars (current) =="
env | grep -E '^(HTTP|HTTPS|ALL|NO)_PROXY=' || echo "(none set)"
