-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathstop_testnet.sh
executable file
·33 lines (24 loc) · 1.11 KB
/
stop_testnet.sh
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
#!/bin/bash
#DOCKERFILE_GENESIS=./docker/docker-compose-testnet-genesis.yml
#DOCKERFILE_VALIDATOR=./docker/docker-compose-testnet-validator.yml
WORKING_DIR=${WORKING_DIR:-$(realpath ./)}
COMPOSE_FILE=${WORKING_DIR}/docker-compose-testnet.yaml
OUTPUT_DIR=${OUTPUT_DIR:-$(realpath ./configfiles)}
IMAGE_TAG=${IMAGE_TAG:-"v1.7.2"}
TESTNET_NAME=${TESTNET_NAME:-"ripple-testnet"}
UNL_MANAGER_ENABLE=${UNL_MANAGER_ENABLE:-true}
CONFIGFILES=${OUTPUT_DIR} IMAGE_TAG=${IMAGE_TAG} TESTNET_NAME=$TESTNET_NAME docker-compose -f ${COMPOSE_FILE} down
docker-compose -f ${WORKING_DIR}/monitoring_system/monitoring_compose.yml down
if [[ -n "$UNL_MANAGER_ENABLE" && "$UNL_MANAGER_ENABLE" == true ]]; then
# Stop UNL manager
TESTNET_NAME=$TESTNET_NAME docker-compose -f ${WORKING_DIR}/xrpl-unl-manager/docker/docker-compose.yml down
fi;
if [[ -n $TESTNET_NAME ]]; then
running_testnet=$TESTNET_NAME
else
running_testnet=$(docker network ls --filter=name=${TESTNET_NAME} --format "{{.Name}}" | head -n 1)
fi;
if [[ -n $running_testnet ]] ; then
echo "Found a running ripple-testnet. Removing..."
docker network rm $running_testnet
fi;