diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2017-07-22 15:03:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2017-07-22 22:28:26 +0000 |
commit | bba3f75fde63d7ae34dd75f0491c7d685501f964 (patch) | |
tree | a122b1ad53fd3e8e3fe11149152efc01c611dfa2 | |
parent | Adding error messages in curl container create script if required decompresso... (diff) | |
download | compute-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>
-rwxr-xr-x | share/scripts/curl | 12 |
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)}" |