mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
fix(setup.sh): Add legacy config path check (#2250)
This commit is contained in:
parent
fb77d3f721
commit
50e629abd0
15
setup.sh
15
setup.sh
|
@ -12,6 +12,7 @@ DESIRED_CONFIG_PATH=
|
||||||
DIR="$(pwd)"
|
DIR="$(pwd)"
|
||||||
DMS_CONFIG='/tmp/docker-mailserver'
|
DMS_CONFIG='/tmp/docker-mailserver'
|
||||||
IMAGE_NAME=
|
IMAGE_NAME=
|
||||||
|
DEFAULT_IMAGE_NAME='docker.io/mailserver/docker-mailserver:latest'
|
||||||
INFO=
|
INFO=
|
||||||
PODMAN_ROOTLESS=false
|
PODMAN_ROOTLESS=false
|
||||||
USE_SELINUX=
|
USE_SELINUX=
|
||||||
|
@ -49,7 +50,7 @@ function _show_local_usage
|
||||||
${LBLUE}Config path, container or image adjustments${RESET}
|
${LBLUE}Config path, container or image adjustments${RESET}
|
||||||
-i IMAGE_NAME
|
-i IMAGE_NAME
|
||||||
Provides the name of the 'docker-mailserver' image. The default value is
|
Provides the name of the 'docker-mailserver' image. The default value is
|
||||||
'${WHITE}docker.io/mailserver/docker-mailserver:latest${RESET}'
|
'${WHITE}${DEFAULT_IMAGE_NAME}${RESET}'
|
||||||
|
|
||||||
-c CONTAINER_NAME
|
-c CONTAINER_NAME
|
||||||
Provides the name of the running container.
|
Provides the name of the running container.
|
||||||
|
@ -102,8 +103,17 @@ function _get_absolute_script_directory
|
||||||
DIR="$(realpath -e -L "${0}")"
|
DIR="$(realpath -e -L "${0}")"
|
||||||
DIR="${DIR%/setup.sh}"
|
DIR="${DIR%/setup.sh}"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _set_default_config_path
|
||||||
|
{
|
||||||
|
if [[ -d "${DIR}/config" ]]
|
||||||
|
then
|
||||||
|
# legacy path (pre v10.2.0)
|
||||||
DEFAULT_CONFIG_PATH="${DIR}/config"
|
DEFAULT_CONFIG_PATH="${DIR}/config"
|
||||||
|
else
|
||||||
|
DEFAULT_CONFIG_PATH="${DIR}/docker-data/dms/config"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function _handle_config_path
|
function _handle_config_path
|
||||||
|
@ -149,6 +159,7 @@ function _run_in_new_container
|
||||||
function _main
|
function _main
|
||||||
{
|
{
|
||||||
_get_absolute_script_directory
|
_get_absolute_script_directory
|
||||||
|
_set_default_config_path
|
||||||
|
|
||||||
local OPTIND
|
local OPTIND
|
||||||
while getopts ":c:i:p:zZR" OPT
|
while getopts ":c:i:p:zZR" OPT
|
||||||
|
@ -205,7 +216,7 @@ function _main
|
||||||
[[ -z ${IMAGE_NAME} ]] && IMAGE_NAME=${INFO%;*}
|
[[ -z ${IMAGE_NAME} ]] && IMAGE_NAME=${INFO%;*}
|
||||||
if [[ -z ${IMAGE_NAME} ]]
|
if [[ -z ${IMAGE_NAME} ]]
|
||||||
then
|
then
|
||||||
IMAGE_NAME=${NAME:-docker.io/mailserver/docker-mailserver:latest}
|
IMAGE_NAME=${NAME:-${DEFAULT_IMAGE_NAME}}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test -t 0
|
if test -t 0
|
||||||
|
|
Loading…
Reference in a new issue