Files
storyforge/scripts/status_collector.sh
2026-03-14 21:32:55 +08:00

16 lines
352 B
Bash
Executable File

#!/bin/sh
set -eu
PID_FILE="/Users/kris/code/StoryForge/data/collector/collector.pid"
if [ -f "$PID_FILE" ]; then
PID="$(cat "$PID_FILE" || true)"
if [ -n "$PID" ] && kill -0 "$PID" 2>/dev/null; then
echo "running:$PID"
exit 0
fi
fi
if lsof -nP -iTCP:8081 -sTCP:LISTEN >/dev/null 2>&1; then
echo "running:port"
else
echo "stopped"
fi