diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-08-19 08:06:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2021-08-19 09:20:40 +0000 |
commit | f7359323e5caf8f532f9ec528b7b8934c4911d92 (patch) | |
tree | e9dc6e60070486cf789159b75101fd64efe70bb0 /libexec/container | |
parent | Copying build-scripts as create-scripts to refactor and unify get and build s... (diff) | |
download | compute-tools-f7359323e5caf8f532f9ec528b7b8934c4911d92.tar.xz compute-tools-f7359323e5caf8f532f9ec528b7b8934c4911d92.zip |
Avoid passing create command parameter to scripts in container create command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | libexec/container/create | 6 |
1 files changed, 5 insertions, 1 deletions
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}" |