From bba3f75fde63d7ae34dd75f0491c7d685501f964 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 22 Jul 2017 17:03:14 +0200 Subject: 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 --- share/scripts/curl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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)}" -- cgit v1.2.3