Rename function and adjust comment (#2306)

This commit is contained in:
Casper 2021-11-28 17:02:07 +01:00 committed by GitHub
parent babae05d4a
commit a8a39a0a1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -316,8 +316,8 @@ function _obtain_hostname_and_domainname
DOMAINNAME="${DOMAINNAME:-${HOSTNAME}}" DOMAINNAME="${DOMAINNAME:-${HOSTNAME}}"
} }
# Remove string input with empty line, only whitespace or `#` as the first non-whitespace character. # Check if string input is an empty line, only whitespaces or `#` as the first non-whitespace character.
function _strip_comments function _is_comment
{ {
grep -q -E "^\s*$|^\s*#" <<< "${1}" grep -q -E "^\s*$|^\s*#" <<< "${1}"
} }

View file

@ -28,7 +28,7 @@ function _relayhost_sasl
# add domain-specific auth from config file: # add domain-specific auth from config file:
while read -r LINE while read -r LINE
do do
if ! _strip_comments "${LINE}" if ! _is_comment "${LINE}"
then then
echo "${LINE}" >> /etc/postfix/sasl_passwd echo "${LINE}" >> /etc/postfix/sasl_passwd
fi fi