From d5f497e7aa35de31ff20142701d48e0713d29900 Mon Sep 17 00:00:00 2001 From: Joey Ross Date: Thu, 25 Jan 2024 22:49:29 -0600 Subject: [PATCH 1/3] updating STARTCOMMAND to array with += syntax and allowing spaces in server name and passwords --- scripts/start.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index 91590765e..206ec0917 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 From b08323e0e951d0081c16078a761fb5192b5e0696 Mon Sep 17 00:00:00 2001 From: Joey Ross Date: Fri, 26 Jan 2024 10:43:11 -0600 Subject: [PATCH 2/3] expanding array correctly --- scripts/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start.sh b/scripts/start.sh index 206ec0917..daadc1ccf 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -76,4 +76,4 @@ EOL printf "\e[0;32m*****STARTING SERVER*****\e[0m\n" echo "${STARTCOMMAND}" -su steam -c "${STARTCOMMAND}" +su steam -c "${STARTCOMMAND[@]}" From a010a9b4910b6d1d17c5697d9a605e87d77115fd Mon Sep 17 00:00:00 2001 From: Joey Ross Date: Fri, 26 Jan 2024 11:06:47 -0600 Subject: [PATCH 3/3] adding expansion to echo as well --- scripts/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start.sh b/scripts/start.sh index daadc1ccf..0efb9c27b 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -75,5 +75,5 @@ password: ${ADMIN_PASSWORD} EOL printf "\e[0;32m*****STARTING SERVER*****\e[0m\n" -echo "${STARTCOMMAND}" +echo "${STARTCOMMAND[@]}" su steam -c "${STARTCOMMAND[@]}"