1
0
mirror of https://github.com/tomav/docker-mailserver.git synced 2024-07-02 14:11:12 +02:00
docker-mailserver/target/scripts/startup/check-stack.sh
Casper c7e9dd2bad
function _defunc removed (#2199)
* function _defunc removed

* _shutdown is better than just notify in that cases

* PANIC_TYPE 'fail-init' introduced

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
2021-09-23 19:49:07 +02:00

25 lines
530 B
Bash

#! /bin/bash
function check
{
_notify 'tasklog' 'Checking configuration'
for FUNC in "${FUNCS_CHECK[@]}"
do
${FUNC}
done
}
function _check_hostname
{
_notify 'task' 'Checking that hostname/domainname is provided or overridden'
_notify 'inf' "Domain has been set to ${DOMAINNAME}"
_notify 'inf' "Hostname has been set to ${HOSTNAME}"
# HOSTNAME should be an FQDN (eg: hostname.domain)
if ! grep -q -E '^(\S+[.]\S+)$' <<< "${HOSTNAME}"
then
_shutdown 'Setting hostname/domainname is required'
fi
}