From 3f1dabf3a849e8943f92b37f5d349fa2ba1fd468 Mon Sep 17 00:00:00 2001
From: andrew bezella <andrew@diatribes.org>
Date: Mon, 9 Aug 2021 12:12:53 -0700
Subject: [PATCH] remove old LUKS header backup file prior to regenerating with
 luksHeaderBackup

---
 handlers/sys.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/handlers/sys.in b/handlers/sys.in
index bc68307..ca6470f 100644
--- a/handlers/sys.in
+++ b/handlers/sys.in
@@ -600,6 +600,7 @@ if [ "$luksheaders" == "yes" ]; then
          label=${dev#/dev/}
          label=${label//\//-}
          outputfile=${luksheadersfile//__star__/$label}
+         rm -f "${outputfile}"
          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