-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-connection.sh
More file actions
55 lines (46 loc) · 1.59 KB
/
Copy pathtest-connection.sh
File metadata and controls
55 lines (46 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# Test if Net Control services are responding
echo "Testing Net Control Application..."
echo ""
# Test port 80
echo "1. Testing http://localhost ..."
if curl -s -o /dev/null -w "%{http_code}" http://localhost | grep -q "200\|301\|302"; then
echo " ✅ Frontend is responding on port 80"
FRONTEND_PORT=80
elif curl -s -o /dev/null -w "%{http_code}" http://localhost:8080 | grep -q "200\|301\|302"; then
echo " ✅ Frontend is responding on port 8080"
FRONTEND_PORT=8080
else
echo " ❌ Frontend is not responding"
echo " Try: docker logs netcontrol-frontend"
FRONTEND_PORT=0
fi
echo ""
# Test backend
echo "2. Testing backend API..."
BACKEND_RESPONSE=$(curl -s http://localhost:5000/api/health 2>&1)
if echo "$BACKEND_RESPONSE" | grep -q "Net Control"; then
echo " ✅ Backend API is responding"
echo " Response: $BACKEND_RESPONSE"
else
echo " ❌ Backend API is not responding"
echo " Try: docker logs netcontrol-backend"
fi
echo ""
# Check Docker containers
echo "3. Docker container status:"
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}" | grep -E "NAME|netcontrol"
echo ""
echo "================================"
if [ $FRONTEND_PORT -gt 0 ]; then
echo "✅ Application is ready!"
echo " Access at: http://localhost:$FRONTEND_PORT"
else
echo "❌ Application is not ready yet"
echo ""
echo "Troubleshooting steps:"
echo "1. Wait 30-60 seconds (first start is slow)"
echo "2. Check logs: docker-compose logs -f"
echo "3. See QUICK_FIX.md for solutions"
fi
echo "================================"