| 123456789101112131415161718192021222324252627282930313233343536373839 | #!/bin/bash. mailcow.confNAME="redis-mailcow"client() {    docker exec -it ${NAME} /bin/bash -c "redis-cli"}if [[  ${1} == "--client" ]]; then    client	exit 0elif [[ ! -z ${1} ]]; then    echo "Unknown parameter"    exit 1fiecho "Stopping and removing containers with name tag ${NAME}..."if [[ ! -z $(docker ps -af "name=${NAME}" -q) ]]; then    docker stop $(docker ps -af "name=${NAME}" -q)    docker rm $(docker ps -af "name=${NAME}" -q)fiif [[ ! -z "$(docker images -q redis:${DBVERS})" ]]; then    read -r -p "Found image locally. Delete local image and repull? [y/N] " response    response=${response,,}    if [[ $response =~ ^(yes|y)$ ]]; then        docker rmi redis:${DBVERS}    fifidocker run \	-v ${PWD}/data/db/redis/:/data/ \	--network=${DOCKER_NETWORK} \	--network-alias=redis \	-h redis \	--name=${NAME} \	-d redis:${REDISVERS} --appendonly yes
 |