IS_LOCALHOST_IN_POSTFIX_MYDESTINATION: set grep quiet

This commit is contained in:
William Hirigoyen 2023-02-14 17:31:30 +01:00
parent c852fb188d
commit e5aa1aa323
2 changed files with 3 additions and 1 deletions

View file

@ -12,6 +12,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
### Removed
### Fixed
* IS_LOCALHOST_IN_POSTFIX_MYDESTINATION: set grep quiet.
### Security

View file

@ -134,7 +134,7 @@ check_dpkgwarning() {
# Check if localhost, localhost.localdomain and localhost.$mydomain are set in Postfix mydestination option.
check_localhost_in_postfix_mydestination() {
# shellcheck disable=SC2016
if ! grep mydestination /etc/postfix/main.cf | grep --extended-regexp 'localhost[^\\.]' | grep 'localhost.localdomain' | grep 'localhost.$mydomain'; then
if ! grep mydestination /etc/postfix/main.cf | grep --quiet --extended-regexp '(localhost[^\\.]|localhost.localdomain|localhost.$mydomain)'; then
failed "IS_LOCALHOST_IN_POSTFIX_MYDESTINATION" "'localhost' and/or 'localhost.localdomain' and/or 'localhost.\$mydomain' are missing in Postfix mydestination option. Consider adding then."
fi
}