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