Improve the startup commands and unbreak their execution

This commit is contained in:
Dane Everitt 2021-05-29 10:19:11 -07:00
parent e4e52642d2
commit 0248368c01
7 changed files with 56 additions and 37 deletions

View file

@ -33,11 +33,13 @@ export INTERNAL_IP
# Switch to the container's working directory # Switch to the container's working directory
cd /home/container || exit 1 cd /home/container || exit 1
# 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"
exec env "$PARSED"

View file

@ -33,11 +33,12 @@ export INTERNAL_IP
# Switch to the container's working directory # Switch to the container's working directory
cd /home/container || exit 1 cd /home/container || exit 1
# 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
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"
exec env "$PARSED"

View file

@ -33,10 +33,12 @@ export INTERNAL_IP
# Switch to the container's working directory # Switch to the container's working directory
cd /home/container || exit 1 cd /home/container || exit 1
# 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"
exec env "$PARSED"

View file

@ -36,10 +36,12 @@ cd /home/container || exit 1
# Print Go version # Print Go version
go version go 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"
exec env "$PARSED"

View file

@ -36,10 +36,12 @@ cd /home/container || exit 1
# Print Java version # Print Java version
java -version java -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"
exec env "$PARSED"

8
java/test.sh Normal file
View file

@ -0,0 +1,8 @@
#!/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

@ -36,10 +36,12 @@ cd /home/container || exit 1
# Print Node.js version # Print Node.js version
node -v node -v
# 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"
exec env "$PARSED"