Repository navigation
Expand file tree
/
Copy pathstop-dev.sh
More file actions
executable file
·58 lines (52 loc) · 2.34 KB
/
Copy pathstop-dev.sh
File metadata and controls
executable file
·58 lines (52 loc) · 2.34 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
#!/bin/bash
# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo -e "${BLUE}════════════════════════════════════════════════════════════${NC}"
echo -e "${BLUE} Stopping Miles Booking System${NC}"
echo -e "${BLUE}════════════════════════════════════════════════════════════${NC}"
echo ""
# Stop API
if [ -f logs/api.pid ]; then
API_PID=$(cat logs/api.pid)
echo -e "${YELLOW}Stopping API (PID: $API_PID)...${NC}"
kill $API_PID 2>/dev/null
rm logs/api.pid
echo -e "${GREEN}✓ API stopped${NC}"
else
echo -e "${YELLOW}⚠️ No API PID file found${NC}"
# Try to kill any process on port 3000
if lsof -ti :3000 > /dev/null 2>&1; then
echo -e "${YELLOW}Stopping process on port 3000...${NC}"
lsof -ti :3000 | xargs kill -9 2>/dev/null
echo -e "${GREEN}✓ Port 3000 cleared${NC}"
fi
fi
# Stop Chat App
if [ -f logs/chat-app.pid ]; then
CHAT_PID=$(cat logs/chat-app.pid)
echo -e "${YELLOW}Stopping Chat App (PID: $CHAT_PID)...${NC}"
kill $CHAT_PID 2>/dev/null
rm logs/chat-app.pid
echo -e "${GREEN}✓ Chat App stopped${NC}"
else
echo -e "${YELLOW}⚠️ No Chat App PID file found${NC}"
# Try to kill any process on port 3001
if lsof -ti :3001 > /dev/null 2>&1; then
echo -e "${YELLOW}Stopping process on port 3001...${NC}"
lsof -ti :3001 | xargs kill -9 2>/dev/null
echo -e "${GREEN}✓ Port 3001 cleared${NC}"
fi
fi
# Stop Docker containers
echo -e "${YELLOW}Stopping Docker containers...${NC}"
docker-compose stop > /dev/null 2>&1
echo -e "${GREEN}✓ Docker containers stopped${NC}"
echo ""
echo -e "${GREEN}════════════════════════════════════════════════════════════${NC}"
echo -e "${GREEN}✓ All services stopped${NC}"
echo -e "${GREEN}════════════════════════════════════════════════════════════${NC}"
echo ""