forked from bootdotdev/learn-pub-sub-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrabbit.sh
More file actions
executable file
·30 lines (27 loc) · 740 Bytes
/
Copy pathrabbit.sh
File metadata and controls
executable file
·30 lines (27 loc) · 740 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
#!/bin/bash
start_or_run () {
docker inspect peril_rabbitmq > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Starting Peril RabbitMQ container..."
docker start peril_rabbitmq
else
echo "Peril RabbitMQ container not found, creating a new one..."
docker run -d --name peril_rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.13-management
fi
}
case "$1" in
start)
start_or_run
;;
stop)
echo "Stopping Peril RabbitMQ container..."
docker stop peril_rabbitmq
;;
logs)
echo "Fetching logs for Peril RabbitMQ container..."
docker logs -f peril_rabbitmq
;;
*)
echo "Usage: $0 {start|stop|logs}"
exit 1
esac