Modify scripts
parent
63e023c3a6
commit
0fbe522500
|
@ -3,9 +3,10 @@
|
|||
# This script will remove all containers and hyperledger related images
|
||||
|
||||
# Detecting whether can import the header file to render colorful cli output
|
||||
# Need add choice option
|
||||
if [ -f ./header.sh ]; then
|
||||
source ./header.sh
|
||||
elif [ -f worker_node_setup/header.sh ]; then
|
||||
elif [ -f scripts/header.sh ]; then
|
||||
source scripts/header.sh
|
||||
else
|
||||
alias echo_r="echo"
|
||||
|
@ -13,10 +14,32 @@ else
|
|||
alias echo_b="echo"
|
||||
fi
|
||||
|
||||
echo_b "Clean up all containers..."
|
||||
docker rm -f `docker ps -qa`
|
||||
|
||||
echo_b "Clean up all hyperledger related images..."
|
||||
docker rmi $(docker images |grep 'hyperledger')
|
||||
|
||||
echo_g "Env cleanup done!"
|
||||
while true
|
||||
do
|
||||
echo_b " ================== Clean up env ================\n"
|
||||
echo_b "1 Clean all containers"
|
||||
echo_b "2 Clean all chaincode-images"
|
||||
echo_r "3 [warning]Clean all hyperledger-images"
|
||||
echo_b "q quit"
|
||||
echo_b " ==================================\n"
|
||||
read -p "Choice the number and enter:" select
|
||||
echo_b "====================================\n"
|
||||
case $select in
|
||||
q|Q)
|
||||
break
|
||||
;;
|
||||
1)
|
||||
echo_b "Clean up all containers..."
|
||||
docker rm -f `docker ps -qa`
|
||||
;;
|
||||
2)
|
||||
echo_b "Clean up all chaincode-images..."
|
||||
docker rmi -f $(docker images |grep 'dev-peer*'|awk '{print $3}')
|
||||
;;
|
||||
3)
|
||||
echo_b "Clean up all hyperledger related images..."
|
||||
docker rmi $(docker images |grep 'hyperledger')
|
||||
;;
|
||||
esac
|
||||
done
|
||||
echo_g "Env cleanup done!"
|
|
@ -3,7 +3,7 @@
|
|||
# Detecting whether can import the header file to render colorful cli output
|
||||
if [ -f ./header.sh ]; then
|
||||
source ./header.sh
|
||||
elif [ -f worker_node_setup/header.sh ]; then
|
||||
elif [ -f scripts/header.sh ]; then
|
||||
source scripts/header.sh
|
||||
else
|
||||
alias echo_r="echo"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Detecting whether can import the header file to render colorful cli output
|
||||
if [ -f ./header.sh ]; then
|
||||
source ./header.sh
|
||||
elif [ -f worker_node_setup/header.sh ]; then
|
||||
elif [ -f scripts/header.sh ]; then
|
||||
source scripts/header.sh
|
||||
else
|
||||
alias echo_r="echo"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Detecting whether can import the header file to render colorful cli output
|
||||
if [ -f ./header.sh ]; then
|
||||
source ./header.sh
|
||||
elif [ -f worker_node_setup/header.sh ]; then
|
||||
elif [ -f scripts/header.sh ]; then
|
||||
source scripts/header.sh
|
||||
else
|
||||
alias echo_r="echo"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Detecting whether can import the header file to render colorful cli output
|
||||
if [ -f ./header.sh ]; then
|
||||
source ./header.sh
|
||||
elif [ -f worker_node_setup/header.sh ]; then
|
||||
elif [ -f scripts/header.sh ]; then
|
||||
source scripts/header.sh
|
||||
else
|
||||
alias echo_r="echo"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Detecting whether can import the header file to render colorful cli output
|
||||
if [ -f ./header.sh ]; then
|
||||
source ./header.sh
|
||||
elif [ -f worker_node_setup/header.sh ]; then
|
||||
elif [ -f scripts/header.sh ]; then
|
||||
source scripts/header.sh
|
||||
else
|
||||
alias echo_r="echo"
|
||||
|
|
Loading…
Reference in New Issue