Skip to content

Commit 2070e84

Browse files
Merge pull request #1148 from BastilleBSD/tschettervictor-patch-2
export: Exit if sha can't be generated
2 parents 9006792 + 5174c27 commit 2070e84

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

usr/local/share/bastille/export.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,13 +417,12 @@ jail_export() {
417417
error_exit "[ERROR]: Failed to export jail: ${TARGET}"
418418
else
419419
if [ -z "${USER_EXPORT}" ]; then
420-
421420
# Generate container checksum file
422421
cd "${bastille_backupsdir}" || error_exit "[ERROR]: Failed to change to directory: ${bastille_backupsdir}"
423-
sha256 -q "${TARGET}_${DATE}${FILE_EXT}" > "${TARGET}_${DATE}.sha256"
424-
422+
if ! sha256 -q "${TARGET}_${DATE}${FILE_EXT}" > "${TARGET}_${DATE}.sha256"; then
423+
error_exit "[ERROR]: Failed to generate sha256 file."
424+
fi
425425
info "\nExported '${bastille_backupsdir}/${TARGET}_${DATE}${FILE_EXT}' successfully."
426-
427426
fi
428427
exit 0
429428
fi

0 commit comments

Comments
 (0)