From 8e7e68c373398ce62eca488b0ce7ef289f5cbce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Fri, 28 Jan 2022 20:16:35 +0100 Subject: [PATCH] Manage error on unzip archive --- scripts/download_clonezilla.sh | 5 +++-- scripts/download_diag_tools.sh | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/download_clonezilla.sh b/scripts/download_clonezilla.sh index 76903b0..f83b314 100755 --- a/scripts/download_clonezilla.sh +++ b/scripts/download_clonezilla.sh @@ -184,11 +184,12 @@ Create ${CZ_INSTALLER_DIR} tree." && error_message "${CZ_TEMP_FILE} is empty." 3 debug_message "FOR loop − ${ARCH} − \ Uncompress PXE files from ${CZ_TEMP_FILE} ." - unzip -qq -j "${CZ_TEMP_FILE}" live/vmlinuz live/initrd.img live/filesystem.squashfs -d . + unzip -qq -j "${CZ_TEMP_FILE}" live/vmlinuz live/initrd.img live/filesystem.squashfs -d . \ + || error_message "Can't properly extract ${CZ_TEMP_FILE} archive." ### }}} ### Remove temp file - rm --recursive --force -- "${CZ_TEMP_FILE}" \ + rm --force -- "${CZ_TEMP_FILE}" \ || error_message "Can't remove ${CZ_TEMP_FILE} temp file." ### Add flag file to know that this version is available diff --git a/scripts/download_diag_tools.sh b/scripts/download_diag_tools.sh index 8ead5e0..1726007 100755 --- a/scripts/download_diag_tools.sh +++ b/scripts/download_diag_tools.sh @@ -240,7 +240,8 @@ EOF download_file "${GPARTED_URL}" "${GPARTED_TEMP_FILE}" is_file_empty "${GPARTED_TEMP_FILE}" \ && error_message "${GPARTED_TEMP_FILE} is empty." 3 - unzip -qq -j "${GPARTED_TEMP_FILE}" live/filesystem.squashfs live/initrd.img live/vmlinuz -d . + unzip -qq -j "${GPARTED_TEMP_FILE}" live/filesystem.squashfs live/initrd.img live/vmlinuz -d . \ + || error_message "Can't properly extract ${GPARTED_TEMP_FILE} archive." rm --force -- "${GPARTED_TEMP_FILE}"