-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop.sh
More file actions
executable file
·34 lines (29 loc) · 956 Bytes
/
stop.sh
File metadata and controls
executable file
·34 lines (29 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
ROOT="$(cd "$(dirname "$0")" && pwd)"
LOGS="$ROOT/tmp/logs"
stop_pid() {
local name="$1"
local pidfile="$LOGS/${name}.pid"
if [ -f "$pidfile" ]; then
local pid
pid=$(cat "$pidfile")
if kill -0 "$pid" 2>/dev/null; then
kill "$pid" && echo "[dockermissions] Stopped $name (pid $pid)"
else
echo "[dockermissions] $name was not running"
fi
rm -f "$pidfile"
else
echo "[dockermissions] No pid file for $name"
fi
}
stop_pid backend
stop_pid frontend
# Fallback: kill any stray tsx/vite processes if PID files were missing
pkill -f "tsx.*src/index" 2>/dev/null && echo "[dockermissions] Killed stray backend process" || true
pkill -f "vite" 2>/dev/null && echo "[dockermissions] Killed stray frontend process" || true
# Wait for port 3000 to be free before returning
for i in $(seq 1 10); do
curl -s http://localhost:3000/api/health > /dev/null 2>&1 || break
sleep 0.5
done