Files
PlantAI-rag-new/agent/methodology/scripts/status.sh
T

14 lines
517 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# agent/methodology/scripts/status.sh —— 状态检查(进程 + /health)
set -uo pipefail
AGENT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PORT="${1:-7920}"
PID_FILE="$AGENT_ROOT/run/methodology-$PORT.pid"
if [[ -f "$PID_FILE" ]] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
echo "Methodology RUNNING pid=$(cat "$PID_FILE") port=$PORT"
else
echo "Methodology NOT RUNNING (port=$PORT)"
fi
curl -s --max-time 5 "http://127.0.0.1:$PORT/health" 2>/dev/null | head -c 300
echo