-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop-all.sh
More file actions
executable file
·34 lines (27 loc) · 815 Bytes
/
stop-all.sh
File metadata and controls
executable file
·34 lines (27 loc) · 815 Bytes
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
#!/bin/bash
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m' # No Color
PID_FILE="./running_processes.txt"
if [ ! -f "$PID_FILE" ]; then
echo -e "${RED}No running processes file found.${NC}"
echo "Either no processes were started with start-multiple.sh, or the PID file was deleted."
exit 1
fi
echo -e "${YELLOW}Stopping all Temporal Rate Limit Tester processes...${NC}"
echo ""
# Read PIDs and stop them
while IFS=: read -r type pid; do
if kill -0 "$pid" 2>/dev/null; then
kill "$pid" 2>/dev/null
echo " - Stopped $type (PID: $pid)"
else
echo " - Process $type (PID: $pid) was already stopped"
fi
done < "$PID_FILE"
# Remove the PID file
rm "$PID_FILE"
echo ""
echo -e "${GREEN}All processes have been stopped.${NC}"