mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-08 16:34:49 +02:00
start-mailserver.sh split (#1820)
* splitting start-mailserver.sh * refactoring part 2 * refactored setup-stack.sh * stzarted adjusting target/bin/*.sh to use new usage format * corrected lowercase-uppercase test error * better handling of .bashrc variable export * linting tests and fix for default assignements * last stylistic changes and rebase
This commit is contained in:
parent
2262d354db
commit
c881facbd2
21 changed files with 2214 additions and 2278 deletions
31
target/scripts/startup/check-stack.sh
Normal file
31
target/scripts/startup/check-stack.sh
Normal file
|
@ -0,0 +1,31 @@
|
|||
#! /bin/bash
|
||||
|
||||
function check
|
||||
{
|
||||
_notify 'tasklog' 'Checking configuration'
|
||||
for FUNC in "${FUNCS_CHECK[@]}"
|
||||
do
|
||||
${FUNC} || _defunc
|
||||
done
|
||||
}
|
||||
|
||||
function _check_hostname
|
||||
{
|
||||
_notify 'task' 'Checking that hostname/domainname is provided or overridden'
|
||||
|
||||
if [[ -n ${OVERRIDE_HOSTNAME} ]]
|
||||
then
|
||||
export HOSTNAME=${OVERRIDE_HOSTNAME}
|
||||
export DOMAINNAME="${HOSTNAME#*.}"
|
||||
fi
|
||||
|
||||
_notify 'inf' "Domain has been set to ${DOMAINNAME}"
|
||||
_notify 'inf' "Hostname has been set to ${HOSTNAME}"
|
||||
|
||||
if ! grep -q -E '^(\S+[.]\S+)$' <<< "${HOSTNAME}"
|
||||
then
|
||||
_notify 'err' 'Setting hostname/domainname is required'
|
||||
kill "$(< /var/run/supervisord.pid)"
|
||||
return 1
|
||||
fi
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue