-
Notifications
You must be signed in to change notification settings - Fork 0
/
updown.sh
45 lines (37 loc) · 879 Bytes
/
updown.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
#
# Copyright IBM Corp All Rights Reserved
#
# SPDX-License-Identifier: Apache-2.0
set -e
function networkUp() {
scripts/genesis.sh
sleep 1
echo "start docker-compose up=================="
docker-compose -f docker-compose-cli.yaml up -d
# sleep 5
# docker exec cli scripts/poor.sh
}
function networkDown() {
echo "start docker-compose down=================="
docker-compose -f docker-compose-cli.yaml down --volumes --remove-orphan
}
function printHelp() {
echo "./updown.sh [command]"
echo "up ---启动网络"
echo "down ---关闭网络"
echo "restart ---重启网络"
echo "-----------------------"
}
MODE=$1
if [ "${MODE}" == "up" ]; then
networkUp
elif [ "${MODE}" == "down" ]; then ## Clear the network
networkDown
elif [ "${MODE}" == "restart" ]; then ## Restart the network
networkDown
networkUp
else
printHelp
exit 1
fi