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 <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2023-10-29 20:55:20 +00:00
parent f31b4694c8
commit 8717bab5c3
No known key found for this signature in database
1 changed files with 8 additions and 0 deletions

View File

@ -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() {