From f7359323e5caf8f532f9ec528b7b8934c4911d92 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 19 Aug 2021 10:06:36 +0200 Subject: Avoid passing create command parameter to scripts in container create command. Signed-off-by: Daniel Baumann --- libexec/container/create | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libexec/container') diff --git a/libexec/container/create b/libexec/container/create index 13a3bc8..e12fa00 100755 --- a/libexec/container/create +++ b/libexec/container/create @@ -30,6 +30,8 @@ MACHINES="/var/lib/machines" SCRIPTS="/usr/share/${SOFTWARE}/create-scripts" CONFIG_TEMPLATE="/usr/share/${SOFTWARE}/config/container.conf.in" +SCRIPT_OPTIONS="" + Parameters () { GETOPT_LONGOPTIONS="name:,cnt.auto:,cnt.container-server:,cnt.overlay:,cnt.overlay-options:,cnt.start:,bind:,bind-ro:,capability:,drop-capability:,script:,verbose," @@ -50,6 +52,7 @@ Parameters () case "${1}" in -n|--name) NAME="${2}" + SCRIPT_OPTIONS="${SCRIPT_OPTIONS} --name ${NAME}" shift 2 ;; @@ -105,6 +108,7 @@ Parameters () -v|--verbose) VERBOSE="true" + SCRIPT_OPTIONS="${SCRIPT_OPTIONS} --verbose" shift 1 ;; @@ -272,7 +276,7 @@ sed -e "s|@CNT_AUTO@|${CNT_AUTO}|g" \ "${CONFIG_TEMPLATE}" > "${CONFIG}/${NAME}.conf" # Run -"${SCRIPTS}/${SCRIPT}" $(echo "${@}" | sed -e 's| -- | |') +"${SCRIPTS}/${SCRIPT}" ${SCRIPT_OPTIONS} $(echo "${@}" | awk -F\ \-\-\ '{ print $2 }') # Post hooks for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}" -- cgit v1.2.3