set -euo pipefail
printf '== date ==\n'; date -Is
printf '== dns ==\n'; getent ahosts openapi.alipay.com | head -20 || true
printf '== curl alipay HEAD/POST-ish ==\n'
for opt in "" "-4"; do echo "--- curl $opt"; timeout 12 curl $opt -vkI --connect-timeout 5 --max-time 10 https://openapi.alipay.com/gateway.do 2>&1 | tail -80 || true; done
printf '== route/ip ==\n'; ip route || true
printf '== env proxy current process ==\n'
pid=$(ss -ltnp | awk '/:48090/ {match($0,/pid=([0-9]+)/,m); if(m[1]) print m[1]}' | head -1 || true)
[ -n "$pid" ] && tr '\0' '\n' < /proc/$pid/environ | grep -Ei 'proxy|ALIPAY_GATEWAY|HTTP|HTTPS' | sed -E 's#(://)[^/@]+@#\1<auth>@#g' || true
