Files
shaitoken/stop_service.sh
2025-04-15 05:58:55 +00:00

21 lines
485 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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