From 5174c272517473b19c2c26728b5c78d1521c31f9 Mon Sep 17 00:00:00 2001 From: tschettervictor <85497460+tschettervictor@users.noreply.github.com> Date: Mon, 16 Jun 2025 23:03:10 -0600 Subject: [PATCH] export: Exit if sha can't be generated --- usr/local/share/bastille/export.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/usr/local/share/bastille/export.sh b/usr/local/share/bastille/export.sh index 9b8c70b4..ebbfdb24 100644 --- a/usr/local/share/bastille/export.sh +++ b/usr/local/share/bastille/export.sh @@ -417,13 +417,12 @@ jail_export() { error_exit "[ERROR]: Failed to export jail: ${TARGET}" else if [ -z "${USER_EXPORT}" ]; then - # Generate container checksum file cd "${bastille_backupsdir}" || error_exit "[ERROR]: Failed to change to directory: ${bastille_backupsdir}" - sha256 -q "${TARGET}_${DATE}${FILE_EXT}" > "${TARGET}_${DATE}.sha256" - + if ! sha256 -q "${TARGET}_${DATE}${FILE_EXT}" > "${TARGET}_${DATE}.sha256"; then + error_exit "[ERROR]: Failed to generate sha256 file." + fi info "\nExported '${bastille_backupsdir}/${TARGET}_${DATE}${FILE_EXT}' successfully." - fi exit 0 fi