arc-frp/app/health-check.sh

59 lines
1.6 KiB
Bash
Raw Normal View History

2025-07-03 15:50:13 -04:00
#!/bin/bash
# Health check script for FRP Manager
# This script checks if all services are running correctly
echo "🔍 FRP Manager Health Check"
echo "=========================="
# Check if main application is running
echo "📡 Checking main application..."
if curl -s http://localhost:3000/health > /dev/null; then
echo "✅ Main application is running"
else
echo "❌ Main application is not accessible"
exit 1
fi
# Check if API is responding
echo "🔌 Checking API endpoints..."
if curl -s http://localhost:3000/api/tunnels > /dev/null; then
echo "✅ API is responding"
else
echo "❌ API is not responding"
exit 1
fi
# Check if FRPC container is running (if Docker is available)
if command -v docker &> /dev/null; then
echo "🐳 Checking FRPC container..."
if docker ps | grep -q frpc; then
echo "✅ FRPC container is running"
else
echo "⚠️ FRPC container is not running (this is expected in development)"
fi
else
echo "⚠️ Docker is not available, skipping FRPC container check"
fi
# Check if database is accessible
echo "🗄️ Checking database..."
if [ -f "./data/tunnels.db" ]; then
echo "✅ Database file exists"
else
echo " Database file doesn't exist yet (will be created on first use)"
fi
# Check if configuration directory exists
echo "📁 Checking configuration directory..."
if [ -d "./data" ]; then
echo "✅ Configuration directory exists"
else
echo "❌ Configuration directory is missing"
exit 1
fi
echo ""
echo "🎉 Health check completed successfully!"
echo "👉 Open http://localhost:3000 to access the FRP Manager"