mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
Check if CONTAINER_IP could be determined (#2046)
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
4822709000
commit
7293e3c9e8
|
@ -208,3 +208,9 @@ function _monitored_files_checksums
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
export -f _monitored_files_checksums
|
export -f _monitored_files_checksums
|
||||||
|
|
||||||
|
function _shutdown
|
||||||
|
{
|
||||||
|
_notify 'err' "Shutting down.."
|
||||||
|
kill 1
|
||||||
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ function _check_hostname
|
||||||
if ! grep -q -E '^(\S+[.]\S+)$' <<< "${HOSTNAME}"
|
if ! grep -q -E '^(\S+[.]\S+)$' <<< "${HOSTNAME}"
|
||||||
then
|
then
|
||||||
_notify 'err' 'Setting hostname/domainname is required'
|
_notify 'err' 'Setting hostname/domainname is required'
|
||||||
kill "$(< /var/run/supervisord.pid)"
|
_shutdown
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -1108,6 +1108,12 @@ function _setup_docker_permit
|
||||||
grep 'inet ' | sed 's|[^0-9\.\/]*||g' | cut -d '/' -f 1)
|
grep 'inet ' | sed 's|[^0-9\.\/]*||g' | cut -d '/' -f 1)
|
||||||
CONTAINER_NETWORK="$(echo "${CONTAINER_IP}" | cut -d '.' -f1-2).0.0"
|
CONTAINER_NETWORK="$(echo "${CONTAINER_IP}" | cut -d '.' -f1-2).0.0"
|
||||||
|
|
||||||
|
if [[ -z ${CONTAINER_IP} ]]
|
||||||
|
then
|
||||||
|
_notify 'err' "Detecting the container IP address failed. Check if NETWORK_INTERFACE is correctly configured."
|
||||||
|
_shutdown
|
||||||
|
fi
|
||||||
|
|
||||||
while read -r IP
|
while read -r IP
|
||||||
do
|
do
|
||||||
CONTAINER_NETWORKS+=("${IP}")
|
CONTAINER_NETWORKS+=("${IP}")
|
||||||
|
@ -1156,7 +1162,7 @@ function _setup_postfix_virtual_transport
|
||||||
if [[ -z ${POSTFIX_DAGENT} ]]
|
if [[ -z ${POSTFIX_DAGENT} ]]
|
||||||
then
|
then
|
||||||
_notify 'err' "${POSTFIX_DAGENT} not set."
|
_notify 'err' "${POSTFIX_DAGENT} not set."
|
||||||
kill -15 "$(< /var/run/supervisord.pid)"
|
_shutdown
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue