Files
pedigree-draw/stop.sh
gbanyan 8b07e483d2
Some checks failed
Deploy to GitHub Pages / build (push) Has been cancelled
Deploy to GitHub Pages / deploy (push) Has been cancelled
Initial commit
2025-12-14 21:53:34 +08:00

29 lines
735 B
Bash
Executable File

#!/bin/bash
# Pedigree Draw - Stop Server Script
cd "$(dirname "$0")"
if [ -f ".server.pid" ]; then
PID=$(cat .server.pid)
if kill -0 "$PID" 2>/dev/null; then
echo "Stopping server (PID: $PID)..."
kill "$PID"
rm -f .server.pid
echo "Server stopped."
else
echo "Server process not found. Cleaning up..."
rm -f .server.pid
fi
else
# Try to find and kill any running vite process for this project
PIDS=$(pgrep -f "vite.*pedigree-draw")
if [ -n "$PIDS" ]; then
echo "Found running server process(es): $PIDS"
echo "Stopping..."
kill $PIDS 2>/dev/null
echo "Server stopped."
else
echo "No server is running."
fi
fi