-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop.sh
More file actions
executable file
·44 lines (38 loc) · 1.06 KB
/
stop.sh
File metadata and controls
executable file
·44 lines (38 loc) · 1.06 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
#!/bin/bash
# code-rag-mcp 로컬 서버 종료
stopped=false
if [ -f /tmp/code-rag-slack.pid ]; then
PID=$(cat /tmp/code-rag-slack.pid)
if kill -0 "$PID" 2>/dev/null; then
kill "$PID"
echo "슬랙 봇 종료 (PID: $PID)"
stopped=true
fi
rm -f /tmp/code-rag-slack.pid
fi
if [ -f /tmp/code-rag-api.pid ]; then
PID=$(cat /tmp/code-rag-api.pid)
if kill -0 "$PID" 2>/dev/null; then
kill "$PID"
echo "API 서버 종료 (PID: $PID)"
stopped=true
fi
rm -f /tmp/code-rag-api.pid
fi
# PID 파일 없이 실행 중인 프로세스 정리
if pgrep -f "server/api_server.py" > /dev/null 2>&1; then
pkill -f "server/api_server.py"
echo "API 서버 종료 (프로세스 탐색)"
stopped=true
fi
if pgrep -f "server/slack_bot.py" > /dev/null 2>&1; then
pkill -f "server/slack_bot.py"
echo "슬랙 봇 종료 (프로세스 탐색)"
stopped=true
fi
if [ "$stopped" = true ]; then
echo ""
echo "code-rag-mcp 종료 완료!"
else
echo "실행 중인 서버가 없습니다."
fi