summaryrefslogtreecommitdiffstats
path: root/share/scripts/curl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-22 15:03:14 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-22 22:28:26 +0000
commitbba3f75fde63d7ae34dd75f0491c7d685501f964 (patch)
treea122b1ad53fd3e8e3fe11149152efc01c611dfa2 /share/scripts/curl
parentAdding error messages in curl container create script if required decompresso... (diff)
downloadcompute-tools-bba3f75fde63d7ae34dd75f0491c7d685501f964.tar.xz
compute-tools-bba3f75fde63d7ae34dd75f0491c7d685501f964.zip
Dynamically prefer lzip over xz over gz in curl container create script, depending on if required decompressors are already installed on the host system.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xshare/scripts/curl12
1 files changed, 11 insertions, 1 deletions
diff --git a/share/scripts/curl b/share/scripts/curl
index 6602a6f..0bcfd01 100755
--- a/share/scripts/curl
+++ b/share/scripts/curl
@@ -136,8 +136,18 @@ then
exit 1
fi
+if [ -x /usr/bin/lzip ]
+then
+ COMPRESSION="lz"
+elif [ -x /usr/bin/xz ]
+then
+ COMPRESSION="xz"
+else
+ COMPRESSION="gz"
+fi
+
ARCHITECTURE="${ARCHITECTURE:-$(dpkg --print-architecture)}"
-IMAGE="${IMAGE:-debian-stretch-${ARCHITECTURE}.tar.xz}"
+IMAGE="${IMAGE:-debian-stretch-${ARCHITECTURE}.tar.${COMPRESSION}}"
SERVER="${SERVER:-https://files.open-infrastructure.net/system/container/debian}"
PASSWORD="${PASSWORD:-$(dd if=/dev/urandom bs=12 count=1 2> /dev/null | base64)}"