- echo " $tab_heading1$tab_heading2$tab_heading3"" Actions"
- cntr=0
- while read p; do
- if (( $cntr % 3 == 0 ));then
- row=""
- heading=$p
- heading_len=$tab_heading1_len
- fi
- if (( $cntr % 3 == 1));then
- heading=$p
- heading_len=$tab_heading2_len
- fi
- if (( $cntr % 3 == 2));then
- contr=$p
- heading=$p
- heading_len=$tab_heading3_len
- fi
- while (( ${#heading} < $heading_len)); do
- heading="$heading"" "
- done
- row=$row$heading
- if (( $cntr % 3 == 2));then
- echo -ne $row$SAMELINE
- echo -ne " $row ${GREEN}stopping...${EGREEN}${SAMELINE}"
- docker stop $(docker ps -qa --filter name=${contr} --filter network=$DOCKER_SIM_NWNAME) &> /dev/null
- echo -ne " $row ${GREEN}stopped removing...${EGREEN}${SAMELINE}"
- docker rm --force $(docker ps -qa --filter name=${contr} --filter network=$DOCKER_SIM_NWNAME) &> /dev/null
- echo -e " $row ${GREEN}stopped removed ${EGREEN}"
- fi
- let cntr=cntr+1
- done <$running_contr_file
+ if [ ! -z "$running_contr_file_empty" ]; then
+ echo $running_contr_file_empty | indent1
+ else
+ echo " $tab_heading1$tab_heading2$tab_heading3"" Actions"
+ cntr=0
+ while read p; do
+ if (( $cntr % 3 == 0 ));then
+ row=""
+ heading=$p
+ heading_len=$tab_heading1_len
+ fi
+ if (( $cntr % 3 == 1));then
+ heading=$p
+ heading_len=$tab_heading2_len
+ fi
+ if (( $cntr % 3 == 2));then
+ contr=$p
+ heading=$p
+ heading_len=$tab_heading3_len
+ fi
+ while (( ${#heading} < $heading_len)); do
+ heading="$heading"" "
+ done
+ row=$row$heading
+ if (( $cntr % 3 == 2));then
+ echo -ne $row$SAMELINE
+ echo -ne " $row ${GREEN}stopping...${EGREEN}${SAMELINE}"
+ docker stop $(docker ps -qa --filter name=${contr} --filter network=$DOCKER_SIM_NWNAME) &> /dev/null
+ echo -ne " $row ${GREEN}stopped removing...${EGREEN}${SAMELINE}"
+ docker rm --force $(docker ps -qa --filter name=${contr} --filter network=$DOCKER_SIM_NWNAME) &> /dev/null
+ echo -e " $row ${GREEN}stopped removed ${EGREEN}"
+ fi
+ let cntr=cntr+1
+ done <$running_contr_file
+ fi