-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop.sh
More file actions
executable file
·51 lines (41 loc) · 1.44 KB
/
Copy pathstop.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.44 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
#!/bin/bash
# Stop script for AI Learning Platform
# Kills backend and frontend servers
set -e
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Stopping AI Learning Platform servers...${NC}"
# Kill backend (uvicorn)
BACKEND_PIDS=$(pgrep -f "uvicorn app.main:app" || true)
if [ ! -z "$BACKEND_PIDS" ]; then
echo -e "${GREEN}Stopping backend servers...${NC}"
echo "$BACKEND_PIDS" | xargs kill 2>/dev/null || true
sleep 1
# Force kill if still running
echo "$BACKEND_PIDS" | xargs kill -9 2>/dev/null || true
fi
# Kill frontend (next dev)
FRONTEND_PIDS=$(pgrep -f "next dev" || true)
if [ ! -z "$FRONTEND_PIDS" ]; then
echo -e "${GREEN}Stopping frontend servers...${NC}"
echo "$FRONTEND_PIDS" | xargs kill 2>/dev/null || true
sleep 1
# Force kill if still running
echo "$FRONTEND_PIDS" | xargs kill -9 2>/dev/null || true
fi
# Kill any node processes on port 3000
NODE_PIDS=$(lsof -ti:3000 2>/dev/null || true)
if [ ! -z "$NODE_PIDS" ]; then
echo -e "${GREEN}Stopping processes on port 3000...${NC}"
echo "$NODE_PIDS" | xargs kill 2>/dev/null || true
fi
# Kill any python processes on port 8000
PYTHON_PIDS=$(lsof -ti:8000 2>/dev/null || true)
if [ ! -z "$PYTHON_PIDS" ]; then
echo -e "${GREEN}Stopping processes on port 8000...${NC}"
echo "$PYTHON_PIDS" | xargs kill 2>/dev/null || true
fi
echo -e "${GREEN}✓ All servers stopped${NC}"