mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
54904aa02c
* chore(`aliases.sh`): Filepath to local var `DATABASE_VIRTUAL` * chore(`accounts.sh`): Filepath to local var `DATABASE_ACCOUNTS` * chore(`accounts.sh`): Filepath to local var `DATABASE_VIRTUAL` * chore(`accounts.sh`): Filepath to local var `DATABASE_DOVECOT_MASTERS` * chore(`bin/open-dkim`): Filepaths to local vars (accounts,virtual,vhost) * chore(`relay.sh`): Filepath to local var `DATABASE_SASL_PASSWD` * chore: Rename method Prior PR feedback suggested a better helper method name. * chore: Normalize filtering config lines as input for iterating * chore: Remove `_is_comment` helper method No longer serving a purpose with more appropriate filter method for pre-processing the entire config file.
23 lines
553 B
Bash
23 lines
553 B
Bash
#! /bin/bash
|
|
|
|
function _escape
|
|
{
|
|
echo "${1//./\\.}"
|
|
}
|
|
|
|
# Returns input after filtering out lines that are:
|
|
# empty, white-space, comments (`#` as the first non-whitespace character)
|
|
function _get_valid_lines_from_file
|
|
{
|
|
grep --extended-regexp --invert-match "^\s*$|^\s*#" "${1}" || true
|
|
}
|
|
|
|
# Provide the name of an environment variable to this function
|
|
# and it will return its value stored in /etc/dms-settings
|
|
function _get_dms_env_value
|
|
{
|
|
local VALUE
|
|
VALUE=$(grep "^${1}=" /etc/dms-settings | cut -d '=' -f 2)
|
|
printf '%s' "${VALUE:1:-1}"
|
|
}
|