-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop_all_plugins.sh
More file actions
executable file
Β·43 lines (36 loc) Β· 1.18 KB
/
stop_all_plugins.sh
File metadata and controls
executable file
Β·43 lines (36 loc) Β· 1.18 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
#!/bin/bash
# Stop all plugin containers when the main bot stops
echo "π Stopping all plugin containers..."
# Find all containers with simplex.plugin label
PLUGIN_CONTAINERS=$(docker ps --filter "label=simplex.plugin" --format "{{.Names}}" 2>/dev/null)
if [ -z "$PLUGIN_CONTAINERS" ]; then
echo "π No plugin containers found"
exit 0
fi
echo "π Found plugin containers:"
echo "$PLUGIN_CONTAINERS" | while read container; do
echo " - $container"
done
# Stop plugin containers
echo "π Stopping plugin containers..."
for container in $PLUGIN_CONTAINERS; do
echo " Stopping $container..."
docker stop "$container" >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo " β
Stopped $container"
else
echo " β Failed to stop $container"
fi
done
# Remove stopped containers
echo "ποΈ Removing plugin containers..."
for container in $PLUGIN_CONTAINERS; do
echo " Removing $container..."
docker rm "$container" >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo " β
Removed $container"
else
echo " β οΈ Could not remove $container (may already be removed)"
fi
done
echo "β
Plugin container cleanup complete"