37 lines
760 B
Bash
Executable File
37 lines
760 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
kill_port() {
|
|
local port="$1"
|
|
local pids
|
|
|
|
pids="$(lsof -tiTCP:"$port" -sTCP:LISTEN 2>/dev/null || true)"
|
|
if [[ -z "$pids" ]]; then
|
|
return 0
|
|
fi
|
|
|
|
kill $pids 2>/dev/null || true
|
|
sleep 1
|
|
|
|
pids="$(lsof -tiTCP:"$port" -sTCP:LISTEN 2>/dev/null || true)"
|
|
if [[ -n "$pids" ]]; then
|
|
kill -9 $pids 2>/dev/null || true
|
|
fi
|
|
}
|
|
|
|
echo "Stopping Events.WebAPI..."
|
|
kill_port 7295
|
|
pkill -f "/Events.WebAPI/bin/.*/Events.WebAPI" || true
|
|
|
|
echo "Stopping Events.FilesAPI..."
|
|
kill_port 7296
|
|
pkill -f "/Events.FilesAPI/bin/.*/Events.FilesAPI" || true
|
|
|
|
echo "Stopping Events.ClientApp..."
|
|
kill_port 5173
|
|
pkill -f "Events.ClientApp.*node_modules/.bin/vite" || true
|
|
pkill -f "vite" || true
|
|
|
|
echo "Events stack stopped."
|