From fa8bfdc22aa6e7372c86761fd758585635c99aa0 Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Mon, 6 Jun 2022 21:18:37 +1200 Subject: [PATCH] fix: Do not override an existing `CONTAINER_NAME` value (#2622) This bug was causing `setup.sh -c` to target the wrong container (the first DMS container started) if more than one DMS container was running. --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index a82b256e..a17a9eeb 100755 --- a/setup.sh +++ b/setup.sh @@ -205,7 +205,7 @@ function _main INFO=$(${CRI} ps --no-trunc --format "{{.Image}};{{.Names}}" --filter \ label=org.opencontainers.image.title="docker-mailserver" | tail -1) - CONTAINER_NAME=${INFO#*;} + [[ -z ${CONTAINER_NAME} ]] && CONTAINER_NAME=${INFO#*;} [[ -z ${IMAGE_NAME} ]] && IMAGE_NAME=${INFO%;*} if [[ -z ${IMAGE_NAME} ]] then