From be4d0491d9e442d536e85ce1e95672ade54c03c0 Mon Sep 17 00:00:00 2001 From: srnyx <25808801+srnyx@users.noreply.github.com> Date: Mon, 10 Mar 2025 18:45:04 -0400 Subject: [PATCH] Apply #262 to Python entrypoint Works on a local/private docker image --- python/entrypoint.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/python/entrypoint.sh b/python/entrypoint.sh index aab4aea..975cf28 100644 --- a/python/entrypoint.sh +++ b/python/entrypoint.sh @@ -8,9 +8,13 @@ export INTERNAL_IP # Print current Python version python --version -# Replace Startup Variables -MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')) -echo -e ":/home/container$ ${MODIFIED_STARTUP}" +# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell +# variable format of "${VARIABLE}" before evaluating the string and automatically +# replacing the values. +PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g') -# Run the Server -eval ${MODIFIED_STARTUP} +# Display the command we're running in the output, and then execute it with eval +printf "\033[1m\033[33mcontainer@pelican~ \033[0m" +echo "$PARSED" +# shellcheck disable=SC2086 +eval "$PARSED"