1
0
mirror of https://github.com/docker-mailserver/docker-mailserver.git synced 2025-08-07 23:03:10 +02:00

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.
This commit is contained in:
Brennan Kinney
2022-06-06 21:18:37 +12:00
committed by GitHub
parent 0010786d18
commit fa8bfdc22a

View File

@ -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