summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-22 13:11:57 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-22 22:28:26 +0000
commit02a3f4925a1c14e9ee01445072cba8b6b0f97350 (patch)
treef74c70964ce294e0e739248752b6e8eb6ac51022 /share
parentAdjusting messages output in curl container create script. (diff)
downloadcompute-tools-02a3f4925a1c14e9ee01445072cba8b6b0f97350.tar.xz
compute-tools-02a3f4925a1c14e9ee01445072cba8b6b0f97350.zip
Reshuffeling checksum handling in curl container create script.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xshare/scripts/curl44
1 files changed, 26 insertions, 18 deletions
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}"