Merge branch 'hotfix/syshandler-overwrite-luksheaderbackup' into 'master'

sys handler: remove old LUKS header backup file to allow updating

Closes #11333

See merge request liberate/backupninja!58
This commit is contained in:
Jerome Charaoui 2022-03-05 18:48:17 +00:00
commit dd86260f85

View File

@ -600,6 +600,9 @@ if [ "$luksheaders" == "yes" ]; then
label=${dev#/dev/}
label=${label//\//-}
outputfile=${luksheadersfile//__star__/$label}
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`