Skip to content

Commit

Permalink
Resolve quotation parsing issue (#30)
Browse files Browse the repository at this point in the history
* entrypoint.sh changes

* Correct command running

* Update EOL tags
  • Loading branch information
hwalker928 committed Nov 27, 2023
1 parent 5f6b25c commit 6cf97b7
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 31 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- [`java-jre17`](https://github.com/sparkedhost/images/blob/main/java/java-jre17/Dockerfile)
- [`java-jre18`](https://github.com/sparkedhost/images/blob/main/java/java-jre18/Dockerfile)[^eol]
- [`java-jre19`](https://github.com/sparkedhost/images/blob/main/java/java-jre19/Dockerfile)[^eol]
- [`java-jre20`](https://github.com/sparkedhost/images/blob/main/java/java-jre20/Dockerfile)
- [`java-jre20`](https://github.com/sparkedhost/images/blob/main/java/java-jre20/Dockerfile)[^eol]
- [`anti-malware`](https://github.com/sparkedhost/images/blob/main/java/anti-malware/Dockerfile)[^antimalware]

### Node.js images
Expand All @@ -21,7 +21,7 @@
- [`nodejs-13`](https://github.com/sparkedhost/images/blob/main/nodejs/nodejs-13/Dockerfile)[^eol]
- [`nodejs-14`](https://github.com/sparkedhost/images/blob/main/nodejs/nodejs-14/Dockerfile)[^eol]
- [`nodejs-15`](https://github.com/sparkedhost/images/blob/main/nodejs/nodejs-15/Dockerfile)[^eol]
- [`nodejs-16`](https://github.com/sparkedhost/images/blob/main/nodejs/nodejs-16/Dockerfile)
- [`nodejs-16`](https://github.com/sparkedhost/images/blob/main/nodejs/nodejs-16/Dockerfile)[^eol]
- [`nodejs-17`](https://github.com/sparkedhost/images/blob/main/nodejs/nodejs-17/Dockerfile)[^eol]
- [`nodejs-18`](https://github.com/sparkedhost/images/blob/main/nodejs/nodejs-18/Dockerfile)
- [`nodejs-19`](https://github.com/sparkedhost/images/blob/main/nodejs/nodejs-19/Dockerfile)[^eol]
Expand Down
2 changes: 1 addition & 1 deletion bot/bastion/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mongod --fork --dbpath /home/container/mongodb/ --port 27017 --logpath /home/con

# Run the Server
echo -e "${YELLOW}BastionBot starting...${NC}"
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}

# Stop MongoDB
mongo --eval "db.getSiblingDB('admin').shutdownServer()"
4 changes: 2 additions & 2 deletions bot/lavalink/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
cd /home/container

# Make internal Docker IP address available to processes
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Replace Startup Variables.
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo "customer@apollopanel:~# ${MODIFIED_STARTUP}"

# Run the Server
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
2 changes: 1 addition & 1 deletion bot/modmail/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mongod --fork --dbpath /home/container/mongodb/ --port 27017 --logpath /home/con

# Run the Server
echo -e "${YELLOW}Starting bot...${NC}"
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}

# Stop MongoDB
mongod --eval "db.getSiblingDB('admin').shutdownServer()"
2 changes: 1 addition & 1 deletion bot/redbot/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ MODIFIED_STARTUP=$(echo -e $(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/
echo -e "\033[1;33mcustomer@apollopanel:~\$\033[0m ${MODIFIED_STARTUP}"

# Run the Server
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
4 changes: 2 additions & 2 deletions dotnet/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
cd /home/container

# Make internal Docker IP address available to processes.
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Replace Startup variables.
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo "customer@apollopanel:~# ${MODIFIED_STARTUP}"

# Run the Server.
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
4 changes: 2 additions & 2 deletions games/bdsx/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
cd /home/container

# Make internal Docker IP address available to processes.
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Replace Startup variables
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo "customer@apollopanel:~# ${MODIFIED_STARTUP}"

# Run the Server.
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
2 changes: 1 addition & 1 deletion games/dotnet/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')

echo -e "\033[1;33mcustomer@apollopanel:~\$\033[0m ${MODIFIED_STARTUP}"

eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
2 changes: 1 addition & 1 deletion games/liteloader-bds/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo "customer@apollopanel:~# ${MODIFIED_STARTUP}"

# Run the Server
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
2 changes: 1 addition & 1 deletion games/rust/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
cd /home/container

# Make internal Docker IP address available to processes.
export INTERNAL_IP=$(ip route get 1 | awk '{print $NF;exit}')
export INTERNAL_IP=$(ip route get 1 | awk '{print $(NF-2);exit}')

# Rename SteamCMD directory
if [ -d "./steamcmd" ]; then
Expand Down
2 changes: 1 addition & 1 deletion games/source/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')

echo -e "\033[1;33mcustomer@apollopanel:~\$\033[0m ${MODIFIED_STARTUP}"

eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
2 changes: 1 addition & 1 deletion games/valheim/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')

echo -e "\033[1;33mcustomer@apollopanel:~\$\033[0m ${MODIFIED_STARTUP}"

eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
2 changes: 1 addition & 1 deletion games/wine-latest/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')

echo -e "\033[1;33mcustomer@apollopanel:~\$\033[0m :/home/container$ ${MODIFIED_STARTUP}"

eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
2 changes: 1 addition & 1 deletion games/wine-staging/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ MODIFIED_STARTUP=$(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')

echo -e "\033[1;33mcustomer@apollopanel:~\$\033[0m :/home/container$ ${MODIFIED_STARTUP}"

eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
4 changes: 2 additions & 2 deletions generic/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
cd /home/container

# Make internal Docker IP address available to processes.
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Replace Startup variables.
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo "customer@apollopanel:~# ${MODIFIED_STARTUP}"

# Run the Server.
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
2 changes: 1 addition & 1 deletion java/anti-malware/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ JAVA_VER=`java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///'`
echo "Java version: ${JAVA_VER}"

# Make internal Docker IP address available to processes
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Download Spigot Anti-Malware from Github Releases
curl --silent -Lo /home/container/antimalware.jar https://github.com/OpticFusion1/MCAntiMalware/releases/latest/download/MCAntiMalware.jar
Expand Down
11 changes: 5 additions & 6 deletions java/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ JAVA_VER=`java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///'`
echo "Java version: ${JAVA_VER}"

# Make internal Docker IP address available to processes
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Replace startup variables.
MODIFIED_STARTUP=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")

# Check if startup command has -Dterminal.jline=false -Dterminal.ansi=true
JLINE_ARGS=$(echo ${MODIFIED_STARTUP} | grep -o "\-Dterminal.jline=false -Dterminal.ansi=true")
TIMEZONE_INUSE=$(echo ${MODIFIED_STARTUP} | grep -o "\-Duser.timezone=")

# If Lower Xmx is enabled and above variable is empty, add the parameters to the startup command
if [ "${LOWER_XMX}" = 1 ]; then
Expand All @@ -22,9 +24,6 @@ if [ "${LOWER_XMX}" = 1 ]; then
if [ "${SERVER_MEMORY}" == 0 ]; then SERVER_MEMORY=512; fi
fi

# Replace startup variables.
MODIFIED_STARTUP=$(echo "${STARTUP}" | sed -e 's/{{/${/g' -e 's/}}/}/g' | eval echo "$(cat -)")

# If Forge compatibility is enabled and above variable is empty, add the parameters to the startup command
if [ "${FORGE_COMPATIBILITY}" = 1 ] && [ -z "${JLINE_ARGS}" ] && [ -z "${FORGE_VERSION}" ]; then
MODIFIED_STARTUP=$(echo "${MODIFIED_STARTUP}" | sed -E 's/-Xmx([0-9]+)[KMG]?/& -Dterminal.jline=false -Dterminal.ansi=true/')
Expand Down Expand Up @@ -58,4 +57,4 @@ fi
echo -e "\033[1;33mcustomer@apollopanel:~\$\033[0m ${MODIFIED_STARTUP}"

# Run the server.
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
4 changes: 2 additions & 2 deletions nodejs/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ fi
echo "Discord.js version: ${DJS_VER}"

# Make internal Docker IP address available to processes.
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Replace Startup Variables
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo "customer@apollopanel:~# ${MODIFIED_STARTUP}"

# Run the Server.
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}
4 changes: 2 additions & 2 deletions python/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ GIT_VER=`git --version 2>&1 | cut -d' ' -f3 | sed '/^1\./s///'`
echo "Git version: ${GIT_VER}"

# Make internal Docker IP address available to processes
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
export INTERNAL_IP=`ip route get 1 | awk '{print $(NF-2);exit}'`

# Replace Startup Variables.
MODIFIED_STARTUP=$(echo -e ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')
echo "customer@apollopanel:~# ${MODIFIED_STARTUP}"

# Run the Server.
eval ${MODIFIED_STARTUP}
exec env ${MODIFIED_STARTUP}

0 comments on commit 6cf97b7

Please sign in to comment.