fix: revert `__declare_readonly` overcomplication
Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
0ebf820b00
commit
6668cbf0fb
|
@ -1,5 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
DMS_STATE_DIR='/var/mail-state'
|
||||
|
||||
# Consolidate all states into a single directory
|
||||
# (/var/mail-state) to allow persistence using docker volumes
|
||||
function _setup_save_states() {
|
||||
|
|
|
@ -16,17 +16,6 @@ function _early_variables_setup() {
|
|||
__environment_variables_export
|
||||
}
|
||||
|
||||
# Declare a variable as readonly if it is not already set.
|
||||
function __declare_readonly() {
|
||||
local VARIABLE_NAME=${1:?Variable name required when declaring a variable as readonly}
|
||||
local VARIABLE_VALUE=${2:?Variable value required when declaring a variable as readonly}
|
||||
|
||||
if [[ ! -v ${VARIABLE_NAME} ]]; then
|
||||
readonly "${VARIABLE_NAME}=${VARIABLE_VALUE}"
|
||||
VARS[${VARIABLE_NAME}]="${VARIABLE_VALUE}"
|
||||
fi
|
||||
}
|
||||
|
||||
# This function handles variables that are deprecated. This allows a
|
||||
# smooth transition period, without the need of removing a variable
|
||||
# completely with a single version.
|
||||
|
@ -73,10 +62,6 @@ function __environment_variables_general_setup() {
|
|||
VARS[DMS_VMAIL_UID]="${DMS_VMAIL_UID:=5000}"
|
||||
VARS[DMS_VMAIL_GID]="${DMS_VMAIL_GID:=5000}"
|
||||
|
||||
# internal variables are next
|
||||
|
||||
__declare_readonly 'DMS_STATE_DIR' '/var/mail-state'
|
||||
|
||||
# user-customizable are last
|
||||
|
||||
_log 'trace' 'Setting anti-spam & anti-virus environment variables'
|
||||
|
|
Loading…
Reference in New Issue