Skip to content

Commit

Permalink
switched relative paths to absolute paths, moved settings logic to a …
Browse files Browse the repository at this point in the history
…better suited place
  • Loading branch information
MSpreckels committed Feb 9, 2024
1 parent 8e4b4ee commit 43739a3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion scripts/compile-settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fi
mkdir -p /palworld/Pal/Saved/Config/LinuxServer
cat > /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini <<EOF
[/Script/Pal.PalGameWorldSettings]
$(envsubst < ./files/PalWorldSettings.ini.template | tr -d "\n\r")
$(envsubst < /home/steam/server/files/PalWorldSettings.ini.template | tr -d "\n\r")
EOF

echo "Compiling PalWorldSettings.ini done!"
49 changes: 24 additions & 25 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,6 @@ dirExists "/palworld" || exit
isWritable "/palworld" || exit
isExecutable "/palworld" || exit


if [ "${DISABLE_GENERATE_SETTINGS,,}" = false ]; then
printf "\e[0;32m*****GENERATING CONFIGS*****\e[0m\n"
./compile-settings.sh
else
printf "\e[0;32m%s\e[0m\n" "*****CHECKING FOR EXISTING CONFIG*****"

# shellcheck disable=SC2143
if [ ! "$(grep -s '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini)" ]; then

printf "\e[0;32m%s\e[0m\n" "*****GENERATING CONFIG*****"

# Server will generate all ini files after first run.
if [ "$architecture" == "arm64" ]; then
timeout --preserve-status 15s ./PalServer-arm64.sh 1> /dev/null
else
timeout --preserve-status 15s ./PalServer.sh 1> /dev/null
fi

# Wait for shutdown
sleep 5
cp /palworld/DefaultPalWorldSettings.ini /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
fi
fi

cd /palworld || exit

if [ "${UPDATE_ON_BOOT,,}" = true ]; then
Expand Down Expand Up @@ -132,6 +107,30 @@ if [ "${MULTITHREADING,,}" = true ]; then
STARTCOMMAND+=("-useperfthreads" "-NoAsyncLoadingThread" "-UseMultithreadForDS")
fi

if [ "${DISABLE_GENERATE_SETTINGS,,}" = false ]; then
printf "\e[0;32m*****GENERATING CONFIGS*****\e[0m\n"
/home/steam/server/compile-settings.sh
else
printf "\e[0;32m%s\e[0m\n" "*****CHECKING FOR EXISTING CONFIG*****"

# shellcheck disable=SC2143
if [ ! "$(grep -s '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini)" ]; then

printf "\e[0;32m%s\e[0m\n" "*****GENERATING CONFIG*****"

# Server will generate all ini files after first run.
if [ "$architecture" == "arm64" ]; then
timeout --preserve-status 15s ./PalServer-arm64.sh 1> /dev/null
else
timeout --preserve-status 15s ./PalServer.sh 1> /dev/null
fi

# Wait for shutdown
sleep 5
cp /palworld/DefaultPalWorldSettings.ini /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
fi
fi

rm -f "/home/steam/server/crontab"
if [ "${BACKUP_ENABLED,,}" = true ]; then
echo "BACKUP_ENABLED=${BACKUP_ENABLED,,}"
Expand Down

0 comments on commit 43739a3

Please sign in to comment.