summaryrefslogtreecommitdiffstats
path: root/share/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-22 15:04:29 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-07-23 08:20:40 +0000
commitda36343c8dfc826ac6fea5bd3d73e0baeb0fa173 (patch)
treece1e9d6720a2078e9a9905b022d7eea6842df407 /share/scripts
parentRenaming --image option to --system in curl container create script for consi... (diff)
downloadcompute-tools-da36343c8dfc826ac6fea5bd3d73e0baeb0fa173.tar.xz
compute-tools-da36343c8dfc826ac6fea5bd3d73e0baeb0fa173.zip
Adding --setup option in curl container create script to manually specify a custom setup tarball.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'share/scripts')
-rwxr-xr-xshare/scripts/curl11
1 files changed, 8 insertions, 3 deletions
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)}"