-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop.sh
More file actions
executable file
·50 lines (40 loc) · 1.13 KB
/
Copy pathstop.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.13 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
# Labyrinth Stop Script
# Cleanly stops all server and client processes
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${YELLOW}Stopping Labyrinth server and client...${NC}"
echo ""
STOPPED_SOMETHING=false
# Stop server on port 8081
if lsof -ti:8081 >/dev/null 2>&1; then
echo -e " → Stopping server on port 8081"
lsof -ti:8081 | xargs kill -9 2>/dev/null || true
STOPPED_SOMETHING=true
fi
# Stop client processes
if pgrep -f "exec:java" >/dev/null; then
echo -e " → Stopping client processes"
pkill -9 -f "exec:java" || true
STOPPED_SOMETHING=true
fi
# Stop any Spring Boot processes
if pgrep -f "spring-boot:run" >/dev/null; then
echo -e " → Stopping Spring Boot processes"
pkill -9 -f "spring-boot:run" || true
STOPPED_SOMETHING=true
fi
if [ "$STOPPED_SOMETHING" = true ]; then
sleep 1
echo ""
echo -e "${GREEN}✓ All Labyrinth processes stopped${NC}"
else
echo -e "${YELLOW}No running Labyrinth processes found${NC}"
fi
echo ""
echo -e "Server logs: ${YELLOW}/tmp/labyrinth-server.log${NC}"
echo ""