From 2e366792c15eba443cea2b7ea38abf396d9f9c31 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 7 Dec 2021 15:30:41 +0200 Subject: [PATCH 1/2] 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} From e0e3b4bf7b9932da9bc6436cf33e24deeae0f4c0 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 7 Dec 2021 17:59:54 +0200 Subject: [PATCH 2/2] fix(source): windows parameter for auto update --- games/source/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/games/source/entrypoint.sh b/games/source/entrypoint.sh index 3eccb7d..f2f2744 100644 --- a/games/source/entrypoint.sh +++ b/games/source/entrypoint.sh @@ -52,7 +52,7 @@ fi if [ -z ${AUTO_UPDATE} ] || [ "${AUTO_UPDATE}" == "1" ]; then # Update Source Server if [ ! -z ${SRCDS_APPID} ]; then - ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit + ./steamcmd/steamcmd.sh +force_install_dir /home/container +login ${STEAM_USER} ${STEAM_PASS} ${STEAM_AUTH} $( [[ "${WINDOWS_INSTALL}" == "1" ]] && printf %s '+@sSteamCmdForcePlatformType windows' ) +app_update ${SRCDS_APPID} $( [[ -z ${SRCDS_BETAID} ]] || printf %s "-beta ${SRCDS_BETAID}" ) $( [[ -z ${SRCDS_BETAPASS} ]] || printf %s "-betapassword ${SRCDS_BETAPASS}" ) $( [[ -z ${HLDS_GAME} ]] || printf %s "+app_set_config 90 mod ${HLDS_GAME}" ) $( [[ -z ${VALIDATE} ]] || printf %s "validate" ) +quit else echo -e "No appid set. Starting Server" fi