1
1
Fork 0
mirror of https://github.com/docker-mailserver/docker-mailserver synced 2024-04-25 07:15:17 +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
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

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