Apply suggestions from code review
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
parent
24d3ba368c
commit
b007533380
|
@ -99,10 +99,8 @@ function _install_feature_config_templates() {
|
||||||
apt-get "${QUIET}" --no-install-recommends install gettext-base
|
apt-get "${QUIET}" --no-install-recommends install gettext-base
|
||||||
|
|
||||||
# zenv:
|
# zenv:
|
||||||
local URL_ZENV
|
|
||||||
URL_ZENV="https://github.com/numToStr/zenv/releases/download/0.8.0/zenv-0.8.0-$(uname --machine)-unknown-linux-gnu.tar.gz"
|
|
||||||
# Download from GH releases to stdout, then extract the zenv file to make available via PATH:
|
# Download from GH releases to stdout, then extract the zenv file to make available via PATH:
|
||||||
curl -L "${URL_ZENV}" -o - | tar --gzip --extract --directory /usr/local/bin --file - zenv
|
curl -L "https://github.com/numToStr/zenv/releases/download/0.8.0/zenv-0.8.0-$(uname --machine)-unknown-linux-gnu.tar.gz" -o - | tar --gzip --extract --directory /usr/local/bin --file - zenv
|
||||||
}
|
}
|
||||||
|
|
||||||
function _install_dovecot() {
|
function _install_dovecot() {
|
||||||
|
|
|
@ -45,7 +45,7 @@ function _create_config_dovecot() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _create_config_postfix() {
|
function _create_config_postfix() {
|
||||||
local QUERY_KIND=${1}
|
local QUERY_KIND=${1:?QUERY_KIND is required in _create_config_postfix}
|
||||||
local LDAP_CONFIG_FILE="/etc/postfix/ldap/${QUERY_KIND}.cf"
|
local LDAP_CONFIG_FILE="/etc/postfix/ldap/${QUERY_KIND}.cf"
|
||||||
|
|
||||||
_cleanse_config '=' <(cat 2>/dev/null \
|
_cleanse_config '=' <(cat 2>/dev/null \
|
||||||
|
@ -56,9 +56,9 @@ function _create_config_postfix() {
|
||||||
) > "${LDAP_CONFIG_FILE}"
|
) > "${LDAP_CONFIG_FILE}"
|
||||||
|
|
||||||
# Opt-out of generated config if `query_filter` was not configured:
|
# Opt-out of generated config if `query_filter` was not configured:
|
||||||
if ! grep --silent '^query_filter =' "${LDAP_CONFIG_FILE}"; then
|
if ! grep -q '^query_filter =' "${LDAP_CONFIG_FILE}"; then
|
||||||
_log 'warn' "'${LDAP_CONFIG_FILE}' is missing the 'query_filter' setting - disabling"
|
_log 'warn' "'${LDAP_CONFIG_FILE}' is missing the 'query_filter' setting - disabling"
|
||||||
|
|
||||||
sed -i "s/$(_escape_for_sed <<< "${LDAP_CONFIG_FILE}")//" /etc/postfix/main.cf
|
sed -i "s/$(_escape_for_sed "${LDAP_CONFIG_FILE}")//" /etc/postfix/main.cf
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue