#!/usr/bin/env bash
# Pass 6: slow-origin probe — 45s budget to separate "slow but alive" from "dead"
DOMAINS="tslaw.id rsia.kendangsari.com dmark.id surabaya-skincentre.com studiosoft.id abimataconsultant.com"
EPOCH=$(date +%s)
echo "=== PASS6 45s PROBE $(date -u '+%H:%M:%S UTC') ben=BEN_${EPOCH} ==="
for D in $DOMAINS; do
  OUT=$(curl -4 --http1.1 -sL -o /dev/null --connect-timeout 6 --max-time 45 \
        -D /tmp/ben_hdr6_$$.txt \
        -w '%{http_code} t=%{time_total} size=%{size_download}' \
        "https://${D}/?nocache=BEN_${EPOCH}" 2>/dev/null)
  CF=$(grep -i '^cf-cache-status' /tmp/ben_hdr6_$$.txt | tr -d '\r' | head -1)
  echo "${D} | ${OUT} | ${CF:-no-cf-hdr}"
done
rm -f /tmp/ben_hdr6_$$.txt
echo "=== DONE $(date -u '+%H:%M:%S UTC') ==="
