| 12345678910111213141516171819 |
- #!/usr/bin/env bash
- set -euo pipefail
- PORT="${EPHEMERIS_PORT:-7015}"
- PIDS="$(lsof -ti tcp:"$PORT" || true)"
- if [ -z "$PIDS" ]; then
- echo "No listeners found on port $PORT"
- exit 0
- fi
- echo "Stopping listeners on port $PORT: $PIDS"
- kill $PIDS || true
- sleep 1
- PIDS="$(lsof -ti tcp:"$PORT" || true)"
- if [ -n "$PIDS" ]; then
- echo "Force-killing remaining listeners on port $PORT: $PIDS"
- kill -9 $PIDS || true
- fi
|