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
This commit is contained in:
@@ -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}
|
||||
|
Reference in New Issue
Block a user