From a949a96e5e7c6f2c84cb34f8c5d3469bf05d8c6c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 10 Oct 2020 22:35:11 +0200 Subject: tidy: avoid deprecated backtick subshell --- postfix/postfix.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'postfix') diff --git a/postfix/postfix.sh b/postfix/postfix.sh index 75ca1a6..5255959 100755 --- a/postfix/postfix.sh +++ b/postfix/postfix.sh @@ -161,14 +161,14 @@ getlinesfromfile() { for subparam in $@; do case "$subparam" in *=) - oldparam="`echo $subparam | awk -F= '{print $1}'`" + oldparam="$(echo $subparam | awk -F= '{print $1}')" replacements="$replacements;s/,*[^,]*$oldparam[^,]*,*/,/" continue ;; *=*=*) - oldparam="`echo $subparam | awk -F= '{print $1}'`" - newparam="`echo $subparam | awk -F= '{print $2}'`" - newparamfile="`echo $subparam | awk -F= '{print $3}'`" + oldparam="$(echo $subparam | awk -F= '{print $1}')" + newparam="$(echo $subparam | awk -F= '{print $2}')" + newparamfile="$(echo $subparam | awk -F= '{print $3}')" ;; *) oldparam=$subparam @@ -176,7 +176,7 @@ getlinesfromfile() { newparamfile=$subparam ;; esac - newparamvalues="`getlinesfromfile $newparamfile | sed -e 's/.*=[ ]*//' -e 's/,/ /g'`" + newparamvalues="$(getlinesfromfile $newparamfile | sed -e 's/.*=[ ]*//' -e 's/,/ /g')" newstring= for newparamvalue in $newparamvalues; do newstring="${newstring}$newparam $newparamvalue," @@ -205,13 +205,13 @@ _postconf -e 'smtpd_banner = $myhostname NO UCE ESMTP $mail_name (Debian/GNU)' # _postconf -e 'smtpd_helo_required = yes' #fi _postconf -e 'smtpd_helo_required = no' -_postconf -e "`getlinesfromfile permit_mx_backup_networks`" +_postconf -e "$(getlinesfromfile permit_mx_backup_networks)" _postconf -e "maps_rbl_domains =" -_postconf -e "`getlinesfromfile smtpd_client_restrictions reject_rhsbl_client`" -_postconf -e "`getlinesfromfile smtpd_helo_restrictions`" -_postconf -e "`getlinesfromfile smtpd_sender_restrictions reject_rhsbl_sender ${dkimproxy:-sender_access_regex=}`" -_postconf -e "`getlinesfromfile smtpd_recipient_restrictions reject_maps_rbl=reject_rbl_client=maps_rbl_domains`" -_postconf -e "`getlinesfromfile smtpd_data_restrictions`" +_postconf -e "$(getlinesfromfile smtpd_client_restrictions reject_rhsbl_client)" +_postconf -e "$(getlinesfromfile smtpd_helo_restrictions)" +_postconf -e "$(getlinesfromfile smtpd_sender_restrictions reject_rhsbl_sender ${dkimproxy:-sender_access_regex=})" +_postconf -e "$(getlinesfromfile smtpd_recipient_restrictions reject_maps_rbl=reject_rbl_client=maps_rbl_domains)" +_postconf -e "$(getlinesfromfile smtpd_data_restrictions)" # FIXME: clear only specific line (not whole file) when dkimproxy unused if [ -f "$tempdir/sender_access_regex" ]; then -- cgit v1.2.3