Merge pull request #292 from srnyx/patch-1

Apply #262 to Python entrypoint
This commit is contained in:
Michael (Parker) Parker
2025-08-04 15:00:27 -04:00
committed by GitHub
9 changed files with 24 additions and 20 deletions

View File

@@ -12,17 +12,17 @@ export INTERNAL_IP
cd /home/container || exit 1
# Print Java version
printf "\033[1m\033[33mcontainer@pelican~ \033[0mjava -version\n"
printf "\033[1m\033[33mcontainer~ \033[0mjava -version\n"
java -version
# Print Python version
if command -v python &> /dev/null
then
printf "\033[1m\033[33mcontainer@pelican~ \033[0mpython --version\n"
printf "\033[1m\033[33mcontainer~ \033[0mpython --version\n"
python --version
else
printf "\033[1m\033[33mcontainer@pelican~ \033[0mpython3 --version\n"
printf "\033[1m\033[33mcontainer~ \033[0mpython3 --version\n"
python3 --version
fi
@@ -32,7 +32,7 @@ fi
PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g')
# Display the command we're running in the output, and then execute it with eval
printf "\033[1m\033[33mcontainer@pelican~ \033[0m"
printf "\033[1m\033[33mcontainer~ \033[0m"
echo "$PARSED"
# shellcheck disable=SC2086
eval "$PARSED"

View File

@@ -9,7 +9,7 @@ export INTERNAL_IP
export DOTNET_ROOT=/usr/share/
# print the dotnet version on startup
printf "\033[1m\033[33mcontainer@pelican~ \033[0mdotnet --version\n"
printf "\033[1m\033[33mcontainer~ \033[0mdotnet --version\n"
dotnet --version
# Replace Startup Variables

View File

@@ -10,7 +10,7 @@ export INTERNAL_IP
cd /home/container || exit 1
# Print Erlang's version
printf "\033[1m\033[33mcontainer@pelican~ \033[0merl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'\n"
printf "\033[1m\033[33mcontainer~ \033[0merl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'\n"
erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'init:stop()'
# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell
@@ -19,7 +19,7 @@ erl -noshell -eval 'erlang:display(erlang:system_info(system_version))' -eval 'i
PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g')
# Display the command we're running in the output, and then execute it with eval
printf "\033[1m\033[33mcontainer@pelican~ \033[0m"
printf "\033[1m\033[33mcontainer~ \033[0m"
echo "$PARSED"
# shellcheck disable=SC2086
eval "$PARSED"

View File

@@ -12,7 +12,7 @@ export INTERNAL_IP
cd /home/container || exit 1
# Print minetest version
printf "\033[1m\033[33mcontainer@pelican~ \033[0mminetest --version\n"
printf "\033[1m\033[33mcontainer~ \033[0mminetest --version\n"
minetest --version
# Replace Startup Variables

View File

@@ -34,7 +34,7 @@ export INTERNAL_IP
cd /home/container || exit 1
# Print Go version
printf "\033[1m\033[33mcontainer@pelican~ \033[0mgo version\n"
printf "\033[1m\033[33mcontainer~ \033[0mgo version\n"
go version
# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell
@@ -43,7 +43,7 @@ go version
PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g')
# Display the command we're running in the output, and then execute it with eval
printf "\033[1m\033[33mcontainer@pelican~ \033[0m"
printf "\033[1m\033[33mcontainer~ \033[0m"
echo "$PARSED"
# shellcheck disable=SC2086
eval "$PARSED"

View File

@@ -34,7 +34,7 @@ export INTERNAL_IP
cd /home/container || exit 1
# Print Java version
printf "\033[1m\033[33mcontainer@pelican~ \033[0mjava -version\n"
printf "\033[1m\033[33mcontainer~ \033[0mjava -version\n"
java -version
# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell
@@ -43,7 +43,7 @@ java -version
PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g')
# Display the command we're running in the output, and then execute it with eval
printf "\033[1m\033[33mcontainer@pelican~ \033[0m"
printf "\033[1m\033[33mcontainer~ \033[0m"
echo "$PARSED"
# shellcheck disable=SC2086
eval "$PARSED"

View File

@@ -37,7 +37,7 @@ cd /home/container || exit 1
PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g')
# Display the command we're running in the output, and then execute it with eval
printf "\033[1m\033[33mcontainer@pelican~ \033[0m"
printf "\033[1m\033[33mcontainer~ \033[0m"
echo "$PARSED"
# shellcheck disable=SC2086
eval "$PARSED"

View File

@@ -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~ \033[0m"
echo "$PARSED"
# shellcheck disable=SC2086
eval "$PARSED"

View File

@@ -18,7 +18,7 @@ echo "installed youtube-dl Version:"
PARSED=$(echo "$STARTUP" | sed -e 's/{{/${/g' -e 's/}}/}/g')
# Display the command we're running in the output, and then execute it with eval
printf "\033[1m\033[33mcontainer@pelican~ \033[0m"
printf "\033[1m\033[33mcontainer~ \033[0m"
echo "$PARSED"
# shellcheck disable=SC2086
eval "$PARSED"