From da36343c8dfc826ac6fea5bd3d73e0baeb0fa173 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 22 Jul 2017 17:04:29 +0200 Subject: Adding --setup option in curl container create script to manually specify a custom setup tarball. Signed-off-by: Daniel Baumann --- share/scripts/curl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'share/scripts') diff --git a/share/scripts/curl b/share/scripts/curl index 4390dba..7d3a07d 100755 --- a/share/scripts/curl +++ b/share/scripts/curl @@ -26,7 +26,7 @@ CACHE="/var/cache/container-tools/images" Parameters () { - GETOPT_LONGOPTIONS="bind:,bind-ro:,script:,name:,clean,password:,server:,system:," + GETOPT_LONGOPTIONS="bind:,bind-ro:,script:,name:,clean,password:,server:,setup:,system:," GETOPT_OPTIONS="b:,s:,n:,p:" PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${SCRIPT} --options ${GETOPT_OPTIONS} --shell sh -- ${@})" @@ -87,6 +87,11 @@ Parameters () shift 2 ;; + --setup) + SETUP="${2}" + shift 2 + ;; + --system) SYSTEM="${2}" shift 2 @@ -107,7 +112,7 @@ Parameters () Usage () { - echo "Usage: container create -n|--name NAME -s|--script ${SCRIPT} -- [--clean] [-p|--password PASSWORD] [--server SERVER] [--system SYSTEM]" >&2 + echo "Usage: container create -n|--name NAME -s|--script ${SCRIPT} -- [--clean] [-p|--password PASSWORD] [--server SERVER] [--setup SETUP] [--system SYSTEM]" >&2 exit 1 } @@ -152,7 +157,7 @@ fi ARCHITECTURE="${ARCHITECTURE:-$(dpkg --print-architecture)}" SYSTEM="${SYSTEM:-debian-stretch-${ARCHITECTURE}.system.tar.${COMPRESSION}}" -SETUP="$(echo ${SYSTEM} | sed -e 's|.system.tar.|.setup.tar.|')" +SETUP="${SETUP:-$(echo ${SYSTEM} | sed -e 's|.system.tar.|.setup.tar.|')}" 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