diff --git a/scripts/run.sh b/scripts/run.sh index 6709542..77d8601 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -146,10 +146,19 @@ if ! command -v trunk &> /dev/null; then else trunk serve --port "$ADMIN_UI_PORT" > /tmp/supervisor-ui.log 2>&1 & ADMIN_UI_PID=$! - sleep 1 + sleep 2 + + # Check if process is still running if ps -p $ADMIN_UI_PID > /dev/null 2>&1; then - echo "✅" - UI_STARTED=true + # Check for port binding errors in log + if grep -q "Address already in use" /tmp/supervisor-ui.log 2>/dev/null; then + echo "❌" + UI_ERROR="Port $ADMIN_UI_PORT already in use. Run: ./scripts/run.sh --kill-ports" + kill $ADMIN_UI_PID 2>/dev/null + else + echo "✅" + UI_STARTED=true + fi else echo "❌" UI_ERROR="Failed to start"