From e3ffb010e83313d2f1686bc5a060a95eb4e160e6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 24 Jul 2018 17:16:08 +0200 Subject: Adding support for multiple container and host commands in debconf container create script. Signed-off-by: Daniel Baumann --- share/scripts/debconf | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'share/scripts/debconf') diff --git a/share/scripts/debconf b/share/scripts/debconf index 77a974a..a05b067 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -740,6 +740,18 @@ EOF rm -f "${DIRECTORY}/.container-command" fi + + for NUMBER in $(seq 1 ${CONTAINER_COMMAND_NUMBER}) + do + eval COMMAND="$`echo CONTAINER_COMMAND${NUMBER}`" + + echo "${COMMAND}" > "${DIRECTORY}/.container-command" + + chmod 0755 "${DIRECTORY}/.container-command" + Chroot "${DIRECTORY}" "sh /.container-command" + + rm -f "${DIRECTORY}/.container-command" + done } Configure_network () @@ -988,6 +1000,19 @@ Commands () rm -f "${DIRECTORY}/.host-command" fi + for NUMBER in $(seq 1 ${HOST_COMMAND_NUMBER}) + do + eval COMMAND="$`echo HOST_COMMAND${NUMBER}`" + + echo "${COMMAND}" > "${DIRECTORY}/.host-command" + + cd "${DIRECTORY}" + sh "${DIRECTORY}/.host-command" + cd "${OLDPWD}" + + rm -f "${DIRECTORY}/.host-command" + done + # Show root password in case its automatically set case "${ROOT_RANDOM_PASSWORD}" in true) -- cgit v1.2.3