Actually correct command running...

This commit is contained in:
Dane Everitt 2021-05-29 10:52:55 -07:00
parent 0248368c01
commit 5919abae88
8 changed files with 25 additions and 20 deletions

View file

@ -41,5 +41,6 @@ PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat
# Display the command we're running in the output, and then execute it with the env # Display the command we're running in the output, and then execute it with the env
# from the container itself. # from the container itself.
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
exec env "$PARSED" # shellcheck disable=SC2086
exec env ${PARSED}

View file

@ -41,4 +41,5 @@ PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat
# Display the command we're running in the output, and then execute it with the env # Display the command we're running in the output, and then execute it with the env
# from the container itself. # from the container itself.
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
exec env "$PARSED" # shellcheck disable=SC2086
exec env ${PARSED}

View file

@ -41,4 +41,5 @@ PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat
# Display the command we're running in the output, and then execute it with the env # Display the command we're running in the output, and then execute it with the env
# from the container itself. # from the container itself.
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
exec env "$PARSED" # shellcheck disable=SC2086
exec env ${PARSED}

View file

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

View file

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

View file

@ -1,8 +0,0 @@
#!/bin/sh
STARTUP="./foo.sh -env {{HOME}}"
PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
exec env "$PARSED"

View file

@ -34,6 +34,7 @@ export INTERNAL_IP
cd /home/container || exit 1 cd /home/container || exit 1
# Print Node.js version # Print Node.js version
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mnode -v\n"
node -v node -v
# Convert all of the "{{VARIABLE}}" parts of the command into the expected shell # Convert all of the "{{VARIABLE}}" parts of the command into the expected shell
@ -44,4 +45,5 @@ PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat
# Display the command we're running in the output, and then execute it with the env # Display the command we're running in the output, and then execute it with the env
# from the container itself. # from the container itself.
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED" printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
exec env "$PARSED" # shellcheck disable=SC2086
exec env ${PARSED}

View file

@ -34,12 +34,16 @@ export INTERNAL_IP
cd /home/container || exit 1 cd /home/container || exit 1
# Print Python version # Print Python version
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0mpython --version\n"
python --version python --version
# Replace variables in the startup command # Convert all of the "{{VARIABLE}}" parts of the command into the expected shell
MODIFIED_STARTUP=$(eval echo "$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g')") # variable format of "${VARIABLE}" before evaluating the string and automatically
printf '\033[1m\033[33mcontainer@pterodactyl~ \033[0m' # replacing the values.
echo "${MODIFIED_STARTUP}" PARSED=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")
# Run the startup command # Display the command we're running in the output, and then execute it with the env
exec env "${MODIFIED_STARTUP}" # from the container itself.
printf "\033[1m\033[33mcontainer@pterodactyl~ \033[0m%s\n" "$PARSED"
# shellcheck disable=SC2086
exec env ${PARSED}