diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2017-07-22 13:11:57 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2017-07-22 22:28:26 +0000 |
commit | 02a3f4925a1c14e9ee01445072cba8b6b0f97350 (patch) | |
tree | f74c70964ce294e0e739248752b6e8eb6ac51022 /share | |
parent | Adjusting messages output in curl container create script. (diff) | |
download | compute-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-x | share/scripts/curl | 44 |
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}" |