From a45f1915ddb8e3e0d748018a7104829bfe1f5702 Mon Sep 17 00:00:00 2001 From: Luis Gerhorst Date: Thu, 16 Nov 2023 18:17:44 +0100 Subject: [PATCH] cicd/common.sh: Support bullseye --- cicd/common.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cicd/common.sh b/cicd/common.sh index 0a7635952..ce40e744d 100644 --- a/cicd/common.sh +++ b/cicd/common.sh @@ -181,9 +181,8 @@ get_llb_peerIP() { ## Deletes a docker host ## arg1 - hostname delete_docker_host() { - id=`docker ps -f name=$1| grep -w $1 | cut -d " " -f 1 | grep -iv "CONTAINER"` - if [ "$id" != "" ]; then - docker stop $1 2>&1 >> /dev/null + if docker stop $1 2>&1 >> /dev/null + then hd="true" ka=`docker ps -f name=ka_$1| grep -w ka_$1 | cut -d " " -f 1 | grep -iv "CONTAINER"` loxilbs=( "${loxilbs[@]/$1}" ) @@ -196,9 +195,7 @@ delete_docker_host() { $hns del $1 sudo rm -fr "$hexist/$1" 2>&1 >> /dev/null fi - if [ "$id" != "" ]; then - docker rm $1 2>&1 >> /dev/null - fi + docker rm $1 2>&1 >> /dev/null || true } ## Connects two docker hosts