Change 'function' style (#3364)

This commit is contained in:
Casper 2023-05-26 01:01:41 +02:00 committed by GitHub
parent cf74127f78
commit 37ca0f9ba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
60 changed files with 233 additions and 466 deletions

View file

@ -2,14 +2,12 @@
declare -a FUNCS_SETUP
function _register_setup_function
{
function _register_setup_function() {
FUNCS_SETUP+=("${1}")
_log 'trace' "${1}() registered"
}
function _setup
{
function _setup() {
# Requires `shopt -s globstar` because of `**` which in
# turn is required as we're decending through directories
for FILE in /usr/local/bin/setup.d/**/*.sh
@ -28,8 +26,7 @@ function _setup
_prepare_for_change_detection
}
function _early_supervisor_setup
{
function _early_supervisor_setup() {
SUPERVISOR_LOGLEVEL="${SUPERVISOR_LOGLEVEL:-warn}"
if ! grep -q "loglevel = ${SUPERVISOR_LOGLEVEL}" /etc/supervisor/supervisord.conf; then
@ -56,8 +53,7 @@ function _early_supervisor_setup
return 0
}
function _setup_timezone
{
function _setup_timezone() {
[[ -n ${TZ} ]] || return 0
_log 'debug' "Setting timezone to '${TZ}'"
@ -78,8 +74,7 @@ function _setup_timezone
fi
}
function _setup_apply_fixes_after_configuration
{
function _setup_apply_fixes_after_configuration() {
_log 'trace' 'Removing leftover PID files from a stop/start'
find /var/run/ -not -name 'supervisord.pid' -name '*.pid' -delete
touch /dev/shm/supervisor.sock
@ -93,8 +88,7 @@ function _setup_apply_fixes_after_configuration
rm -rf /var/mail-state/spool-postfix/{dev,etc,lib,pid,usr,private/auth}
}
function _run_user_patches
{
function _run_user_patches() {
local USER_PATCHES='/tmp/docker-mailserver/user-patches.sh'
if [[ -f ${USER_PATCHES} ]]; then