-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstop.sh
More file actions
executable file
·28 lines (20 loc) · 829 Bytes
/
stop.sh
File metadata and controls
executable file
·28 lines (20 loc) · 829 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
#!/bin/bash
# Stop all IDS components started by start.sh
echo "Stopping IDS System..."
# Check if PID file exists
if [ -f .running_pids ]; then
# Read PIDs from file
read -r SERVER_PID SURICATA_PID FRONTEND_PID < .running_pids
# Stop the processes
echo "Stopping Backend Server (PID: $SERVER_PID)..."
kill $SERVER_PID 2>/dev/null || echo "Backend Server already stopped"
echo "Stopping Suricata Integration (PID: $SURICATA_PID)..."
kill $SURICATA_PID 2>/dev/null || echo "Suricata Integration already stopped"
echo "Stopping Frontend (PID: $FRONTEND_PID)..."
kill $FRONTEND_PID 2>/dev/null || echo "Frontend already stopped"
# Remove PID file
rm .running_pids
echo "All components stopped successfully!"
else
echo "No running components found."
fi