start bash

This commit is contained in:
2026-04-09 09:43:21 +00:00
parent 5212cab8b6
commit 8409655e66
7 changed files with 245 additions and 7 deletions

31
stop.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RUN_DIR="$ROOT_DIR/.run"
stop_one() {
local name="$1"
local pid_file="$2"
if [[ ! -f "$pid_file" ]]; then
echo "$name is not running"
return 0
fi
local pid
pid="$(cat "$pid_file")"
if [[ -n "$pid" ]] && kill -0 "$pid" >/dev/null 2>&1; then
kill "$pid"
echo "Stopped $name (PID $pid)"
else
echo "$name pid file was stale"
fi
rm -f "$pid_file"
}
stop_one "backend" "$RUN_DIR/backend.pid"
stop_one "frontend" "$RUN_DIR/frontend.pid"