#!/bin/bash # 快速检查当前运行的版本 echo "🔍 快速检查 Gitea Webhook Ambassador 版本..." # 检查 Python 版本 (端口 8000) if lsof -i :8000 > /dev/null 2>&1; then PID=$(lsof -ti :8000) PROCESS=$(ps -p $PID -o comm= 2>/dev/null) if echo "$PROCESS" | grep -q "python\|uvicorn"; then echo "🐍 Python 版本正在运行 (PID: $PID)" echo "🌐 http://localhost:8000" echo "📊 http://localhost:8000/dashboard" exit 0 fi fi # 检查 Go 版本 (端口 8080) if lsof -i :8080 > /dev/null 2>&1; then PID=$(lsof -ti :8080) PROCESS=$(ps -p $PID -o comm= 2>/dev/null) if echo "$PROCESS" | grep -q "gitea-webhook-ambassador"; then echo "🚀 Go 版本正在运行 (PID: $PID)" echo "🌐 http://localhost:8080" exit 0 fi fi echo "❌ 没有检测到任何版本在运行" echo "💡 使用 './devbox start' 启动 Python 版本"