summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-22 12:42:11 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-22 22:28:26 +0000
commit7264f6eeee1a0771f41295c934cc0d2b36d7addb (patch)
tree8d734657d503546da3632d9a4fb8734126586138 /share
parentDynamically prefer lzip over xz over gz in curl container create script, depe... (diff)
downloadcompute-tools-7264f6eeee1a0771f41295c934cc0d2b36d7addb.tar.xz
compute-tools-7264f6eeee1a0771f41295c934cc0d2b36d7addb.zip
Reshuffeling curl options handling in curl container create script.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xshare/scripts/curl10
1 files changed, 6 insertions, 4 deletions
diff --git a/share/scripts/curl b/share/scripts/curl
index 0bcfd01..8ceb7c2 100755
--- a/share/scripts/curl
+++ b/share/scripts/curl
@@ -172,16 +172,18 @@ done
echo "Downloading ${IMAGE}"
mkdir -p "${CACHE}"
-if [ -e "${CACHE}/${IMAGE}" ]
-then
- CURL_OPTIONS="--time-cond ${CACHE}/${IMAGE}"
-fi
+CURL_OPTIONS=""
if curl -V | grep -qs http2
then
CURL_OPTIONS="${CURL_OPTIONS} --http2"
fi
+if [ -e "${CACHE}/${IMAGE}" ]
+then
+ CURL_OPTIONS="${CURL_OPTIONS} --time-cond ${CACHE}/${IMAGE}"
+fi
+
for FILE in "${SERVER}/${IMAGE}" "${SERVER}/${IMAGE}.sha512"
do
if curl --fail --head --output /dev/null --silent "${FILE}"