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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,7 +205,7 @@ function _main
INFO=$(${CRI} ps --no-trunc --format "{{.Image}};{{.Names}}" --filter \ INFO=$(${CRI} ps --no-trunc --format "{{.Image}};{{.Names}}" --filter \
label=org.opencontainers.image.title="docker-mailserver" | tail -1) label=org.opencontainers.image.title="docker-mailserver" | tail -1)
CONTAINER_NAME=${INFO#*;} [[ -z ${CONTAINER_NAME} ]] && CONTAINER_NAME=${INFO#*;}
[[ -z ${IMAGE_NAME} ]] && IMAGE_NAME=${INFO%;*} [[ -z ${IMAGE_NAME} ]] && IMAGE_NAME=${INFO%;*}
if [[ -z ${IMAGE_NAME} ]] if [[ -z ${IMAGE_NAME} ]]
then then