| # remove existed onos and atomix containers and images, stop emulator containers |
| containers=(`docker ps -a | grep -E 'onos-|atomix-|emulator' | awk '{print $1}'`) |
| if [[ ${#containers} != 0 ]]; then |
| for var in ${containers[*]}; do |
| echo "There is no container existed." |
| if [[ $# != 1 || "$1" != "stop-docker" ]]; then |
| if [[ ${#containers} != 0 ]]; then |
| for var in ${containers[*]}; do |
| images=(`docker images | grep -e onos -e none -e "<none>" | awk '{print $3}'`) |
| if [[ ${#images} != 0 ]]; then |
| for var in ${images[*]}; do |
| echo "There is no onos/atomix docker image existed." |
| echo "There is no container and image to be removed." |