#!/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