-
Notifications
You must be signed in to change notification settings - Fork 14
/
stop
executable file
·49 lines (44 loc) · 1.21 KB
/
stop
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
#!/bin/sh
. ./.env
docker-compose version &> /dev/null
if [ $? -eq 127 ]; then
podman-compose version &> /dev/null
if [ $? -eq 127 ]; then
echo "Could not find docker-compose or podman-compose"
exit 1;
else
alias compose_command="podman-compose -f podman-compose-ha.yml"
fi
else
alias compose_command="docker-compose -f docker-compose-ha.yml"
fi
if [ -n "${HA_IP_LIST}" ]; then
./replica_set --remove
RETURN=$?
if [ $RETURN -eq 0 ]; then
compose_command exec -- rabbitmq-stats rabbitmqctl stop_app
compose_command exec -- rabbitmq-stats rabbitmqctl reset
elif [ $RETURN -eq 1 ]; then
exit 0
fi
fi
docker-compose version &> /dev/null
if [ $? -eq 127 ]; then
podman-compose version &> /dev/null
if [ $? -eq 127 ]; then
echo "Could not find docker-compose or podman-compose"
exit 1;
else
if [ -z "${HA_IP_LIST}" ]; then
podman-compose -f podman-compose.yml down -v
else
podman-compose -f podman-compose-ha.yml down -v
fi
fi
else
if [ -z "${HA_IP_LIST}" ]; then
docker-compose down -v
else
docker-compose -f docker-compose-ha.yml down -v
fi
fi