← back to Billy Website

status.sh

45 lines

#!/bin/bash

# Status check for Bill Fox San Diego Rental Website

echo "═══════════════════════════════════════════════════════════"
echo "🏖️ 3306 Lloyd Street - Server Status"
echo "═══════════════════════════════════════════════════════════"

# Check if process is running
if pgrep -f "node server.js" > /dev/null; then
    echo "✅ Server is RUNNING"
    PID=$(pgrep -f "node server.js")
    echo "   PID: $PID"

    # Check if port is listening
    if netstat -tlnp 2>/dev/null | grep -q 9100 || ss -tlnp 2>/dev/null | grep -q 9100; then
        echo "✅ Port 9100 is OPEN"

        # Test HTTP response
        HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:9100/)
        if [ "$HTTP_CODE" = "200" ]; then
            echo "✅ Website is ACCESSIBLE (HTTP $HTTP_CODE)"
        else
            echo "⚠️  Website returned HTTP $HTTP_CODE"
        fi
    else
        echo "❌ Port 9100 is NOT listening"
    fi
else
    echo "❌ Server is NOT RUNNING"
    echo ""
    echo "To start the server, run: ./start.sh"
    exit 1
fi

echo ""
echo "🌐 Access URLs:"
echo "   Local:    http://localhost:9100/"
echo "   Network:  http://0.0.0.0:9100/"
echo "   External: http://45.61.58.125:9100/"
echo ""
echo "📝 View logs:  tail -f server.log"
echo "🛑 Stop:       ./stop.sh"
echo "═══════════════════════════════════════════════════════════"