Skip to content

Commit

Permalink
updating STARTCOMMAND to array with += syntax and allowing spaces in …
Browse files Browse the repository at this point in the history
…server name and passwords
  • Loading branch information
clarkent86 committed Jan 26, 2024
1 parent 9518170 commit d5f497e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 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="${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
Expand Down

0 comments on commit d5f497e

Please sign in to comment.