From 8717bab5c33c5e9ac416349241676d38b1447135 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 29 Oct 2023 20:55:20 +0000 Subject: [PATCH] Ability to pass in an additional command to run when the container starts. Undocumented variable. Potential for danger? Of course. But maybe it is useful. Commented use case - up for discussion Signed-off-by: Adam Warner --- src/start.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/start.sh b/src/start.sh index 66a0792..4ac77cb 100644 --- a/src/start.sh +++ b/src/start.sh @@ -4,6 +4,14 @@ if [ "${PH_VERBOSE:-0}" -gt 0 ]; then set -x fi +# Undocumented environment variable to allow easy injection of arbitrary commands. +# HERE BE DRAGONS! +# Example use case: If mounting the web repo from the host, we need to run `git config --global --add safe.directory /var/www/html/admin` +# in order for the updatechecker to work +if [ -n "${ADDITIONAL_COMMAND}" ]; then + eval "${ADDITIONAL_COMMAND}" +fi + trap stop TERM INT QUIT HUP ERR start() {