From 21abd730ab1e135aa1bd444dac67f8087177231d Mon Sep 17 00:00:00 2001
From: andrew bezella <andrew@diatribes.org>
Date: Mon, 9 Aug 2021 12:19:09 -0700
Subject: [PATCH] match prior rm usage w/test and rm instead of rm -f

---
 handlers/sys.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/handlers/sys.in b/handlers/sys.in
index ca6470f..757c0e4 100644
--- a/handlers/sys.in
+++ b/handlers/sys.in
@@ -600,7 +600,9 @@ if [ "$luksheaders" == "yes" ]; then
          label=${dev#/dev/}
          label=${label//\//-}
          outputfile=${luksheadersfile//__star__/$label}
-         rm -f "${outputfile}"
+         if [ -f "${outputfile}" ]; then
+           rm "${outputfile}"
+         fi
          debug "$CRYPTSETUP will try to backup the LUKS header for device $dev"
          debug "$CRYPTSETUP luksHeaderBackup \"${dev}\" --header-backup-file \"${outputfile}\""
          output=`$CRYPTSETUP luksHeaderBackup "${dev}" --header-backup-file "${outputfile}" 2>&1`
-- 
GitLab