From 2e71f1c6f0aba2f9b945a6782407b8299ca0abaa Mon Sep 17 00:00:00 2001 From: SechPoint Date: Thu, 12 Mar 2026 09:31:12 +0000 Subject: [PATCH] update --- pre-deployment-test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pre-deployment-test.sh b/pre-deployment-test.sh index cf6e061..0177c7a 100644 --- a/pre-deployment-test.sh +++ b/pre-deployment-test.sh @@ -54,16 +54,16 @@ test_conn() { local target=$1 local desc=$2 - # Check if we are on Linux (which supports /dev/tcp) or Mac if [[ "$OSTYPE" == "darwin"* ]]; then - # Mac Fallback: Use curl to check connection - if curl -sk --connect-timeout 3 "https://$target" > /dev/null 2>&1 || [ $? -eq 45 ] || [ $? -eq 35 ]; then + # Mac Fallback: If curl gets ANY status code, the port is open. + # -I (Head only), -s (Silent), -k (Insecure), --max-time 3 + if curl -Is --connect-timeout 3 "https://$target" > /dev/null 2>&1; then echo -e "${GREEN}[PASS]${NC} $desc ($target)" else echo -e "${RED}[FAIL]${NC} $desc ($target) - BLOCKED" fi else - # Linux Native: Faster and more reliable in locked-down environments + # Linux Native (Still the most reliable for VMs) if timeout 3 bash -c "cat < /dev/null > /dev/tcp/$target/443" 2>/dev/null; then echo -e "${GREEN}[PASS]${NC} $desc ($target)" else