mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-06-23 01:09:13 +02:00
change if style (#3361)
This commit is contained in:
parent
0e592aa911
commit
cf74127f78
58 changed files with 297 additions and 594 deletions
|
@ -63,8 +63,7 @@ function _db_operation
|
|||
[[ ${DATABASE} == "${DATABASE_VIRTUAL}" ]] && V_DELIMITER=','
|
||||
|
||||
# Perform requested operation:
|
||||
if _db_has_entry_with_key "${KEY}" "${DATABASE}"
|
||||
then
|
||||
if _db_has_entry_with_key "${KEY}" "${DATABASE}"; then
|
||||
# Find entry for key and return status code:
|
||||
case "${DB_ACTION}" in
|
||||
( 'append' )
|
||||
|
@ -79,8 +78,7 @@ function _db_operation
|
|||
;;
|
||||
|
||||
( 'remove' )
|
||||
if [[ -z ${VALUE} ]]
|
||||
then # Remove entry for KEY:
|
||||
if [[ -z ${VALUE} ]]; then # Remove entry for KEY:
|
||||
sedfile --strict -i "/^${KEY_LOOKUP}/d" "${DATABASE}"
|
||||
else # Remove target VALUE from entry:
|
||||
__db_list_already_contains_value || return 0
|
||||
|
|
|
@ -74,8 +74,7 @@ function _arg_expect_mail_account
|
|||
function _account_should_not_exist_yet
|
||||
{
|
||||
__account_already_exists && _exit_with_error "'${MAIL_ACCOUNT}' already exists"
|
||||
if [[ -f ${DATABASE_VIRTUAL} ]] && grep -q "^${MAIL_ACCOUNT}" "${DATABASE_VIRTUAL}"
|
||||
then
|
||||
if [[ -f ${DATABASE_VIRTUAL} ]] && grep -q "^${MAIL_ACCOUNT}" "${DATABASE_VIRTUAL}"; then
|
||||
_exit_with_error "'${MAIL_ACCOUNT}' is already defined as an alias"
|
||||
fi
|
||||
}
|
||||
|
@ -95,8 +94,7 @@ function __account_already_exists
|
|||
# Also used by addsaslpassword
|
||||
function _password_request_if_missing
|
||||
{
|
||||
if [[ -z ${PASSWD} ]]
|
||||
then
|
||||
if [[ -z ${PASSWD} ]]; then
|
||||
read -r -s -p 'Enter Password: ' PASSWD
|
||||
echo
|
||||
[[ -z ${PASSWD} ]] && _exit_with_error 'Password must not be empty'
|
||||
|
|
|
@ -25,8 +25,7 @@ function _manage_virtual_aliases
|
|||
case "${ACTION}" in
|
||||
# Associate RECIPIENT to MAIL_ALIAS:
|
||||
( 'update' )
|
||||
if [[ -f ${DATABASE_ACCOUNTS} ]] && grep -q "^${MAIL_ALIAS}" "${DATABASE_ACCOUNTS}"
|
||||
then
|
||||
if [[ -f ${DATABASE_ACCOUNTS} ]] && grep -q "^${MAIL_ALIAS}" "${DATABASE_ACCOUNTS}"; then
|
||||
_exit_with_error "'${MAIL_ALIAS}' is already defined as an account"
|
||||
fi
|
||||
_db_entry_add_or_append "${DATABASE_VIRTUAL}" "${MAIL_ALIAS}" "${RECIPIENT}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue