mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-06-28 19:50:16 +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
53
target/scripts/startup/fixes-stack.sh
Normal file
53
target/scripts/startup/fixes-stack.sh
Normal file
|
@ -0,0 +1,53 @@
|
|||
#! /bin/bash
|
||||
|
||||
function fix
|
||||
{
|
||||
_notify 'tasklog' 'Post-configuration checks'
|
||||
for FUNC in "${FUNCS_FIX[@]}"
|
||||
do
|
||||
${FUNC} || _defunc
|
||||
done
|
||||
|
||||
_notify 'inf' 'Removing leftover PID files from a stop/start'
|
||||
rm -rf /var/run/*.pid /var/run/*/*.pid
|
||||
touch /dev/shm/supervisor.sock
|
||||
}
|
||||
|
||||
function _fix_var_mail_permissions
|
||||
{
|
||||
_notify 'task' 'Checking /var/mail permissions'
|
||||
|
||||
# fix permissions, but skip this if 3 levels deep the user id is already set
|
||||
if find /var/mail -maxdepth 3 -a \( \! -user 5000 -o \! -group 5000 \) | read -r
|
||||
then
|
||||
_notify 'inf' 'Fixing /var/mail permissions'
|
||||
chown -R 5000:5000 /var/mail
|
||||
else
|
||||
_notify 'inf' 'Permissions in /var/mail look OK'
|
||||
fi
|
||||
}
|
||||
|
||||
function _fix_var_amavis_permissions
|
||||
{
|
||||
local AMAVIS_STATE_DIR='/var/mail-state/lib-amavis'
|
||||
[[ ${ONE_DIR} -eq 0 ]] && AMAVIS_STATE_DIR="/var/lib/amavis"
|
||||
[[ ! -e ${AMAVIS_STATE_DIR} ]] && return 0
|
||||
|
||||
_notify 'inf' 'Checking and fixing Amavis permissions'
|
||||
chown -hR amavis:amavis "${AMAVIS_STATE_DIR}"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function _fix_cleanup_clamav
|
||||
{
|
||||
_notify 'task' 'Cleaning up disabled Clamav'
|
||||
rm -f /etc/logrotate.d/clamav-*
|
||||
rm -f /etc/cron.d/clamav-freshclam
|
||||
}
|
||||
|
||||
function _fix_cleanup_spamassassin
|
||||
{
|
||||
_notify 'task' 'Cleaning up disabled spamassassin'
|
||||
rm -f /etc/cron.daily/spamassassin
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue