#!/bin/bash
# Test Grav multi-site connectivity

echo "=== Testing Grav Multi-Site on port 12000 ==="
echo ""

# Test basic connectivity
echo "1. Testing localhost:12000..."
exec 3<>/dev/tcp/localhost/12000
echo -e "GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n" >&3
head -5 <&3
exec 3<&-
echo ""

# Test plan.startinglineproductions.com
echo "2. Testing plan.startinglineproductions.com..."
exec 3<>/dev/tcp/localhost/12000
echo -e "GET / HTTP/1.1\r\nHost: plan.startinglineproductions.com\r\nConnection: close\r\n\r\n" >&3
head -5 <&3
exec 3<&-
echo ""

# Test charters.turnsys.com
echo "3. Testing charters.turnsys.com..."
exec 3<>/dev/tcp/localhost/12000
echo -e "GET / HTTP/1.1\r\nHost: charters.turnsys.com\r\nConnection: close\r\n\r\n" >&3
head -5 <&3
exec 3<&-
echo ""

# Test plan.knownelement.com
echo "4. Testing plan.knownelement.com..."
exec 3<>/dev/tcp/localhost/12000
echo -e "GET / HTTP/1.1\r\nHost: plan.knownelement.com\r\nConnection: close\r\n\r\n" >&3
head -5 <&3
exec 3<&-
echo ""

echo "=== Tests complete ==="
