-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop.sh
More file actions
executable file
·66 lines (57 loc) · 1.94 KB
/
Copy pathstop.sh
File metadata and controls
executable file
·66 lines (57 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# CryptoAgent 停止脚本
# 用法: ./stop.sh
# 颜色输出
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${GREEN}🛑 CryptoAgent 停止脚本${NC}"
echo ""
# 停止 tmux 会话
if command -v tmux &> /dev/null; then
if tmux has-session -t tradebot 2>/dev/null; then
echo -e "${YELLOW}正在停止 tmux 会话...${NC}"
tmux kill-session -t tradebot 2>/dev/null
echo -e "${GREEN}✓ tmux 会话已停止${NC}"
else
echo -e "${BLUE}没有发现 tmux 会话${NC}"
fi
fi
# 停止 screen 会话
if command -v screen &> /dev/null; then
for session in tradebot tradebot-api tradebot-agent tradebot-frontend; do
if screen -ls | grep -q "$session"; then
echo -e "${YELLOW}正在停止 screen 会话: $session${NC}"
screen -S "$session" -X quit 2>/dev/null
echo -e "${GREEN}✓ screen 会话 $session 已停止${NC}"
fi
done
fi
# 停止 uvicorn 进程 (API服务)
if pgrep -f "uvicorn.*api:app" > /dev/null; then
echo -e "${YELLOW}正在停止 API 服务 (uvicorn)...${NC}"
pkill -f "uvicorn.*api:app"
echo -e "${GREEN}✓ API 服务已停止${NC}"
fi
# 停止 Agent 服务
if pgrep -f "uvicorn.*main:app.*8001" > /dev/null; then
echo -e "${YELLOW}正在停止 Agent 服务...${NC}"
pkill -f "uvicorn.*main:app.*8001"
echo -e "${GREEN}✓ Agent 服务已停止${NC}"
fi
# 停止 serve 进程 (前端)
if pgrep -f "serve dist" > /dev/null; then
echo -e "${YELLOW}正在停止前端服务 (serve)...${NC}"
pkill -f "serve dist"
echo -e "${GREEN}✓ 前端服务已停止${NC}"
fi
# 停止 node 进程(前端开发服务器)
if pgrep -f "node.*5173" > /dev/null; then
echo -e "${YELLOW}正在停止前端开发服务器...${NC}"
pkill -f "node.*5173"
echo -e "${GREEN}✓ 前端开发服务器已停止${NC}"
fi
echo ""
echo -e "${GREEN}✅ 服务已全部停止${NC}"