Actually correct command running...
This commit is contained in:
@@ -34,12 +34,16 @@ export INTERNAL_IP
|
||||
cd /home/container || exit 1
|
||||
|
||||
# Print Python version
|
||||
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mpython --version\n"
|
||||
python --version
|
||||
|
||||
# Replace variables in the startup command
|
||||
MODIFIED_STARTUP=$(eval echo "$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g')")
|
||||
printf '\033[1m\033[33mcontainer@pterodactyl~ \033[0m'
|
||||
echo "${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' | eval echo "$(cat -)")
|
||||
|
||||
# Run the startup command
|
||||
exec env "${MODIFIED_STARTUP}"
|
||||
# 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}
|
||||
|
Reference in New Issue
Block a user