上传文件至 /
This commit is contained in:
21
stop_service.sh
Normal file
21
stop_service.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# stop_service.sh - 停止服务脚本
|
||||
|
||||
# 颜色定义
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
NC='\033[0m' # 恢复默认颜色
|
||||
|
||||
# 切换到工作目录
|
||||
cd /www/wwwroot/api2.nosqli.com
|
||||
|
||||
# 检查PID文件
|
||||
if [ -f service.pid ]; then
|
||||
pid=$(cat service.pid)
|
||||
echo -e "${YELLOW}停止PID为 $pid 的服务...${NC}"
|
||||
kill $pid
|
||||
rm service.pid
|
||||
echo -e "${GREEN}服务已停止${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}找不到PID文件,服务可能未运行${NC}"
|
||||
fi
|
||||
Reference in New Issue
Block a user