summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-05-03 10:48:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-05-03 10:48:41 +0000
commit6eb5b6f920b237d6304a0aada1eeb35a66d9ef20 (patch)
treee7efe2fca9e2d175d1e4ef8523380e72bd8168a0 /lib
parentAdding upstream version 20180218. (diff)
downloadopen-infrastructure-compute-tools-6eb5b6f920b237d6304a0aada1eeb35a66d9ef20.tar.xz
open-infrastructure-compute-tools-6eb5b6f920b237d6304a0aada1eeb35a66d9ef20.zip
Adding upstream version 20180503.upstream/20180503
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib')
-rwxr-xr-xlib/container/create23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/container/create b/lib/container/create
index 5878e7e..2ffcfda 100755
--- a/lib/container/create
+++ b/lib/container/create
@@ -29,8 +29,8 @@ SCRIPTS="/usr/share/container-tools/scripts"
Parameters ()
{
- GETOPT_LONGOPTIONS="name:,cnt.container-server:,cnt.overlay:,bind:,bind-ro:,capability:,drop-capability:script:,"
- GETOPT_OPTIONS="n:,b:,c:,d:,s:,"
+ GETOPT_LONGOPTIONS="name:,cnt.container-server:,cnt.overlay:,bind:,bind-ro:,capability:,drop-capability:script:,verbose,"
+ GETOPT_OPTIONS="n:,b:,c:,d:,s:,v,"
PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${COMMAND} --options ${GETOPT_OPTIONS} --shell sh -- ${@})"
@@ -90,6 +90,11 @@ Parameters ()
shift 2
;;
+ -v|--verbose)
+ VERBOSE="true"
+ shift 1
+ ;;
+
--)
shift 1
break
@@ -105,7 +110,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container ${COMMAND} -n|--name NAME [--cnt.container-server=true|false|FQDN] [--cnt.overlay=DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED] [-b|--bind DIRECTORY:DIRECTORY[:OPTIONS]] [--bind-ro DIRECTORY:DIRECTORY[:OPTIONS]] [-c|--capability CAPABILITY[,CAPABILITY]] [-d|--drop-capability DROP_CAPABILITY[,DROP_CAPABILITY]] [-s|--script SCRIPT] [-- SCRIPT_OPTIONS]" >&2
+ echo "Usage: container ${COMMAND} -n|--name NAME [--cnt.container-server=true|false|FQDN] [--cnt.overlay=DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED] [-b|--bind DIRECTORY:DIRECTORY[:OPTIONS]] [--bind-ro DIRECTORY:DIRECTORY[:OPTIONS]] [-c|--capability CAPABILITY[,CAPABILITY]] [-d|--drop-capability DROP_CAPABILITY[,DROP_CAPABILITY]] [-s|--script SCRIPT] [-v|--verbose] [-- SCRIPT_OPTIONS]" >&2
exit 1
}
@@ -152,6 +157,18 @@ else
fi
fi
+case "${VERBOSE}" in
+ true)
+
+cat << EOF
+################################################################################
+Creating container: ${NAME}
+################################################################################
+EOF
+
+ ;;
+esac
+
CNT_CONTAINER_SERVER="${CNT_CONTAINER_SERVER:-$(hostname -f)}"
# Pre hooks