From 54ee1e75673d11c20f1297f16fac4c4cf07b0ade Mon Sep 17 00:00:00 2001 From: Casper Date: Tue, 14 Sep 2021 14:07:29 +0200 Subject: [PATCH] Fix delmailuser error handling (#2181) * Update delmailuser * it's ok, when 'sed -i' leaves a file unchanged Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> --- target/bin/delmailuser | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/bin/delmailuser b/target/bin/delmailuser index b3740432..c52668ce 100755 --- a/target/bin/delmailuser +++ b/target/bin/delmailuser @@ -101,7 +101,7 @@ do if [[ -f ${DATABASE} ]] then - if ! sed -i "/^${EMAIL}|/d" "${DATABASE}" + if ! sedfile -i "/^${EMAIL}|/d" "${DATABASE}" then echo "${UNESCAPED_EMAIL} couldn't be deleted in ${DATABASE}." >&2 ERROR=true @@ -126,7 +126,7 @@ do # remove quota directives if [[ -f ${QUOTA_DATABASE} ]] then - if ! sed -i -e "/^${EMAIL}:.*$/d" "${QUOTA_DATABASE}" + if ! sedfile -i -e "/^${EMAIL}:.*$/d" "${QUOTA_DATABASE}" then echo "Quota for ${UNESCAPED_EMAIL} couldn't be deleted in ${QUOTA_DATABASE}." >&2 fi