feat :init

This commit is contained in:
2025-11-02 19:34:16 +08:00
commit b767041311
617 changed files with 124099 additions and 0 deletions

27
stop-server.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
PID_FILE="app.pid"
if [ ! -f "$PID_FILE" ]; then
echo "服务未运行或 PID 文件不存在"
exit 1
fi
PID=$(cat "$PID_FILE")
if ps -p "$PID" > /dev/null 2>&1; then
echo "停止服务中 (PID: $PID)..."
kill "$PID"
sleep 2
if ps -p "$PID" > /dev/null 2>&1; then
echo "进程未结束,尝试强制终止..."
kill -9 "$PID"
fi
echo "服务已停止"
else
echo "未找到运行中的进程,清理 PID 文件"
fi
rm -f "$PID_FILE"