- #!/usr/bin/env bash
- set -euo pipefail
- PORT="${1:-8590}"
- PIDS="$(lsof -ti tcp:"$PORT" 2>/dev/null || true)"
- if [ -n "${PIDS}" ]; then
- kill ${PIDS} 2>/dev/null || true
- sleep 1
- fi
- PIDS="$(lsof -ti tcp:"$PORT" 2>/dev/null || true)"
- if [ -n "${PIDS}" ]; then
- kill -9 ${PIDS} 2>/dev/null || true
- fi
|