From 2e366792c15eba443cea2b7ea38abf396d9f9c31 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 7 Dec 2021 15:30:41 +0200 Subject: [PATCH] ci(source): change startup parsing to eval exec does not support startups that are more keen of scripts with multiple breaks and statements. Ark or 7d2d are examples of this. ref https://github.com/parkervcp/eggs/pull/1420 --- games/source/entrypoint.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/games/source/entrypoint.sh b/games/source/entrypoint.sh index eabbe6e..3eccb7d 100644 --- a/games/source/entrypoint.sh +++ b/games/source/entrypoint.sh @@ -36,10 +36,6 @@ export INTERNAL_IP # Switch to the container's working directory cd /home/container || exit 1 -# 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' | eval echo "$(cat -)") ## just in case someone removed the defaults. if [ "${STEAM_USER}" == "" ]; then @@ -65,8 +61,9 @@ else echo -e "Not updating game server as auto update was set to 0. Starting Server" fi -# Display the command we're running in the output, and then execute it with the env -# from the container itself. -printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" -# shellcheck disable=SC2086 -exec env ${PARSED} +# Replace Startup Variables +MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g') +echo -e ":/home/container$ ${MODIFIED_STARTUP}" + +# Run the Server +eval ${MODIFIED_STARTUP}