From 57750c19790ff91f49f867fd0265008f01ca8e9a Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 24 Feb 2019 17:20:35 +0100 Subject: [PATCH] Fix error when creating first backup. --- hashboot | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hashboot b/hashboot index 3e47069..3f49342 100755 --- a/hashboot +++ b/hashboot @@ -213,7 +213,14 @@ then mv ${DIGEST_FILE_TMP} ${DIGEST_FILE} else write_hashes $DIGEST_FILE - tar -cpPf ${BACKUP_FILE} ${BIOS_TMP} ${MBR_TMP} /boot ${DIGEST_FILE} || die 7 "Error writing ${BACKUP_FILE}" + INCLUDE_FILES="" + if [ -f "${MBR_TMP}" ]; then + INCLUDE_FILES="${INCLUDE_FILES} ${MBR_TMP}" + fi + if [ -f "${BIOS_TMP}" ]; then + INCLUDE_FILES="${BIOS_TMP}" + fi + tar -cpPf "${BACKUP_FILE}" ${INCLUDE_FILES} /boot ${DIGEST_FILE} || die 7 "Error writing ${BACKUP_FILE}" echo "Backup written to ${BACKUP_FILE}" fi