Files
change_cloth_server/proxy/stop.sh
T
2026-03-19 23:51:21 +08:00

20 lines
360 B
Bash
Executable File

#!/usr/bin/env bash
cd "$(dirname "$0")"
PID_FILE=proxy.pid
if [ ! -f "$PID_FILE" ]; then
echo "not running (no pid file)"
exit 1
fi
PID=$(cat "$PID_FILE")
if kill -0 "$PID" 2>/dev/null; then
kill "$PID"
rm -f "$PID_FILE"
echo "stopped (pid $PID)"
else
rm -f "$PID_FILE"
echo "stale pid file removed (process $PID not found)"
fi