diff --git a/scripts/start.sh b/scripts/start.sh index 91590765e..0efb9c27b 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,45 +1,45 @@ #!/bin/bash -STARTCOMMAND="./PalServer.sh" +STARTCOMMAND=("./PalServer.sh") if [ -n "${PORT}" ]; then - STARTCOMMAND="${STARTCOMMAND} -port=${PORT}" + STARTCOMMAND+=("-port=${PORT}") fi if [ -n "${PLAYERS}" ]; then - STARTCOMMAND="${STARTCOMMAND} -players=${PLAYERS}" + STARTCOMMAND+=("-players=${PLAYERS}") fi if [ "${COMMUNITY}" = true ]; then - STARTCOMMAND="${STARTCOMMAND} EpicApp=PalServer" + STARTCOMMAND+=("EpicApp=PalServer") fi if [ -n "${PUBLIC_IP}" ]; then - STARTCOMMAND="${STARTCOMMAND} -publicip=${PUBLIC_IP}" + STARTCOMMAND+=("-publicip=${PUBLIC_IP}") fi if [ -n "${PUBLIC_PORT}" ]; then - STARTCOMMAND="${STARTCOMMAND} -publicport=${PUBLIC_PORT}" + STARTCOMMAND+=("-publicport=${PUBLIC_PORT}") fi if [ -n "${SERVER_NAME}" ]; then - STARTCOMMAND="${STARTCOMMAND} -servername=${SERVER_NAME}" + STARTCOMMAND+=("-servername=${SERVER_NAME}") fi if [ -n "${SERVER_PASSWORD}" ]; then - STARTCOMMAND="${STARTCOMMAND} -serverpassword=${SERVER_PASSWORD}" + STARTCOMMAND+=("-serverpassword=${SERVER_PASSWORD}") fi if [ -n "${ADMIN_PASSWORD}" ]; then - STARTCOMMAND="${STARTCOMMAND} -adminpassword=${ADMIN_PASSWORD}" + STARTCOMMAND+=("-adminpassword=${ADMIN_PASSWORD}") fi if [ -n "${QUERY_PORT}" ]; then - STARTCOMMAND="${STARTCOMMAND} -queryport=${QUERY_PORT}" + STARTCOMMAND+=("-queryport=${QUERY_PORT}") fi if [ "${MULTITHREADING}" = true ]; then - STARTCOMMAND="${STARTCOMMAND} -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS" + STARTCOMMAND+=("-useperfthreads" "-NoAsyncLoadingThread" "-UseMultithreadForDS") fi cd /palworld || exit @@ -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[@]}"