From 02a3f4925a1c14e9ee01445072cba8b6b0f97350 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 22 Jul 2017 15:11:57 +0200 Subject: Reshuffeling checksum handling in curl container create script. Signed-off-by: Daniel Baumann --- share/scripts/curl | 44 ++++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 18 deletions(-) (limited to 'share/scripts') diff --git a/share/scripts/curl b/share/scripts/curl index f3e4927..4f575f9 100755 --- a/share/scripts/curl +++ b/share/scripts/curl @@ -193,30 +193,38 @@ do fi done -if [ -e "${CACHE}/${IMAGE}.sha512" ] && [ -e "${CACHE}/${IMAGE}" ] -then - echo -n "Verifying ${IMAGE}:" - +for FILE in "${CACHE}/$(basename ${IMAGE})" +do cd "${CACHE}" - set +e - sha512sum --check "${IMAGE}.sha512" --status - SHA512SUM="${?}" + if [ ! -e "${FILE}" ] + then + continue + fi - case "${SHA512SUM}" in - 0) - echo " ok." - ;; + if [ -e "${FILE}.sha512" ] + then + echo -n "Verifying ${IMAGE}:" - *) - echo " failed." - exit 1 - ;; - esac + set +e + sha512sum --check "${IMAGE}.sha512" --status + SHA512SUM="${?}" + set -e + + case "${SHA512SUM}" in + 0) + echo " ok." + ;; + + *) + echo " failed." + exit 1 + ;; + esac + fi - set -e cd "${OLDPWD}" -fi +done mkdir -p "${MACHINES}/${NAME}" -- cgit v1.2.3