From c08643d82c6f615da747a8b4dedaac77277d4433 Mon Sep 17 00:00:00 2001 From: jhh Date: Tue, 27 Aug 2019 15:30:23 -0500 Subject: Support arbitrary container init scripts Issue-ID: POLICY-1371 Signed-off-by: jhh Change-Id: Ic1c15e6f36fe3eead937d4595b994747e830eb7a --- .../src/main/resources/docker-entrypoint.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'controlloop') diff --git a/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh b/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh index 73781619e..0c7fab9f8 100644 --- a/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh +++ b/controlloop/packages/docker-controlloop/src/main/resources/docker-entrypoint.sh @@ -63,13 +63,15 @@ function scripts { set -x fi - if ! ls "${POLICY_INSTALL_INIT}"/*.sh 2>&1; then + local scriptExtSuffix=${1:-"sh"} + + if ! ls "${POLICY_INSTALL_INIT}"/*."${scriptExtSuffix}" 2>&1; then return 0 fi source "${POLICY_HOME}"/etc/profile.d/env.sh - for s in $(ls "${POLICY_INSTALL_INIT}"/*.sh 2> /dev/null); do + for s in $(ls "${POLICY_INSTALL_INIT}"/*."${scriptExtSuffix}" 2> /dev/null); do echo "executing script: ${s}" source "${s}" done @@ -206,7 +208,7 @@ function reload { features security properties - scripts + scripts "pre.sh" } function start { @@ -238,6 +240,7 @@ function vmBoot { reload db start + scripts "post.sh" } function dockerBoot { @@ -268,6 +271,8 @@ case "${operation}" in ;; configure) configure ;; + nexus) nexus + ;; *) exec "$@" ;; esac -- cgit 1.2.3-korg