Skip to content

Commit

Permalink
Merge pull request #140 from thijsvanloef/revert-124-update_start_script
Browse files Browse the repository at this point in the history
Revert "updating STARTCOMMAND to array with += syntax and allowing spaces in …"
  • Loading branch information
thijsvanloef authored Jan 26, 2024
2 parents 243420f + 70b4496 commit c6b91ea
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
#!/bin/bash

STARTCOMMAND=("./PalServer.sh")
STARTCOMMAND="./PalServer.sh"

if [ -n "${PORT}" ]; then
STARTCOMMAND+=("-port=${PORT}")
STARTCOMMAND="${STARTCOMMAND} -port=${PORT}"
fi

if [ -n "${PLAYERS}" ]; then
STARTCOMMAND+=("-players=${PLAYERS}")
STARTCOMMAND="${STARTCOMMAND} -players=${PLAYERS}"
fi

if [ "${COMMUNITY}" = true ]; then
STARTCOMMAND+=("EpicApp=PalServer")
STARTCOMMAND="${STARTCOMMAND} EpicApp=PalServer"
fi

if [ -n "${PUBLIC_IP}" ]; then
STARTCOMMAND+=("-publicip=${PUBLIC_IP}")
STARTCOMMAND="${STARTCOMMAND} -publicip=${PUBLIC_IP}"
fi

if [ -n "${PUBLIC_PORT}" ]; then
STARTCOMMAND+=("-publicport=${PUBLIC_PORT}")
STARTCOMMAND="${STARTCOMMAND} -publicport=${PUBLIC_PORT}"
fi

if [ -n "${SERVER_NAME}" ]; then
STARTCOMMAND+=("-servername=${SERVER_NAME}")
STARTCOMMAND="${STARTCOMMAND} -servername=${SERVER_NAME}"
fi

if [ -n "${SERVER_PASSWORD}" ]; then
STARTCOMMAND+=("-serverpassword=${SERVER_PASSWORD}")
STARTCOMMAND="${STARTCOMMAND} -serverpassword=${SERVER_PASSWORD}"
fi

if [ -n "${ADMIN_PASSWORD}" ]; then
STARTCOMMAND+=("-adminpassword=${ADMIN_PASSWORD}")
STARTCOMMAND="${STARTCOMMAND} -adminpassword=${ADMIN_PASSWORD}"
fi

if [ -n "${QUERY_PORT}" ]; then
STARTCOMMAND+=("-queryport=${QUERY_PORT}")
STARTCOMMAND="${STARTCOMMAND} -queryport=${QUERY_PORT}"
fi

if [ "${MULTITHREADING}" = true ]; then
STARTCOMMAND+=("-useperfthreads" "-NoAsyncLoadingThread" "-UseMultithreadForDS")
STARTCOMMAND="${STARTCOMMAND} -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS"
fi

cd /palworld || exit
Expand Down Expand Up @@ -75,5 +75,5 @@ password: ${ADMIN_PASSWORD}
EOL

printf "\e[0;32m*****STARTING SERVER*****\e[0m\n"
echo "${STARTCOMMAND[@]}"
su steam -c "${STARTCOMMAND[@]}"
echo "${STARTCOMMAND}"
su steam -c "${STARTCOMMAND}"

0 comments on commit c6b91ea

Please sign in to comment.