auto-save 2026-05-15 11:18 (+1, ~4)

This commit is contained in:
2026-05-15 11:18:18 +08:00
parent 4d66653ee5
commit 08aed2a053
6 changed files with 117 additions and 14 deletions

26
scripts/stop-dev-background.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PID_DIR="$ROOT_DIR/.pids"
stop_pid_file() {
local name="$1"
local file="$PID_DIR/$name.pid"
if [[ ! -f "$file" ]]; then
echo "$name pid file not found"
return
fi
local pid
pid="$(cat "$file")"
if [[ -n "$pid" ]] && kill -0 "$pid" >/dev/null 2>&1; then
kill -TERM "$pid"
echo "$name stopped: $pid"
else
echo "$name already stopped"
fi
rm -f "$file"
}
stop_pid_file api
stop_pid_file web