Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make booleans case insensitive #261

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,6 @@ It is highly recommended you set the following environment values before startin

*** Required for docker stop to save and gracefully close the server

> [!IMPORTANT]
> Boolean values used in environment variables are case-sensitive because they are used in the shell script.
>
> They must be set using exactly `true` or `false` for the option to take effect.

### Game Ports

| Port | Info |
Expand Down
4 changes: 2 additions & 2 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if [ "${RCON_ENABLED}" = true ]; then
if [ "${RCON_ENABLED,,}" = true ]; then
rcon-cli -c /home/steam/server/rcon.yaml save
fi

Expand All @@ -17,7 +17,7 @@ fi

echo "backup created at $FILE_PATH"

if [ "${DELETE_OLD_BACKUPS}" = true ]; then
if [ "${DELETE_OLD_BACKUPS,,}" = true ]; then
if [ -z "${OLD_BACKUP_DAYS}" ]; then
echo "Unable to deleted old backups, OLD_BACKUP_DAYS is empty."
elif [[ "${OLD_BACKUP_DAYS}" =~ ^[0-9]+$ ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mkdir -p /palworld/backups
chown -R steam:steam /palworld /home/steam/

term_handler() {
if [ "${RCON_ENABLED}" = true ]; then
if [ "${RCON_ENABLED,,}" = true ]; then
rcon-cli save
rcon-cli "shutdown 1"
else # Does not save
Expand Down
20 changes: 10 additions & 10 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if [ "${UPDATE_ON_BOOT}" = true ]; then
if [ "${UPDATE_ON_BOOT,,}" = true ]; then
printf "\e[0;32m*****STARTING INSTALL/UPDATE*****\e[0m\n"
/home/steam/steamcmd/steamcmd.sh +@sSteamCmdForcePlatformType linux +@sSteamCmdForcePlatformBitness 64 +force_install_dir "/palworld" +login anonymous +app_update 2394010 validate +quit
fi
Expand All @@ -15,11 +15,11 @@ if [ -n "${QUERY_PORT}" ]; then
STARTCOMMAND+=("-queryport=${QUERY_PORT}")
fi

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

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

Expand Down Expand Up @@ -291,8 +291,8 @@ if [ -n "${BAN_LIST_URL}" ]; then
echo "BAN_LIST_URL=$BAN_LIST_URL"
sed -E -i "s~BanListURL=\"[^\"]*\"~BanListURL=\"$BAN_LIST_URL\"~" /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
fi
if [ -n "${RCON_ENABLED}" ]; then
echo "RCON_ENABLED=${RCON_ENABLED}"
if [ -n "${RCON_ENABLED,,}" ]; then
echo "RCON_ENABLED=${RCON_ENABLED,,}"
sed -i "s/RCONEnabled=[a-zA-Z]*/RCONEnabled=$RCON_ENABLED/" /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
fi
if [ -n "${RCON_PORT}" ]; then
Expand All @@ -301,18 +301,18 @@ if [ -n "${RCON_PORT}" ]; then
fi

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

echo "$BACKUP_CRON_EXPRESSION bash /usr/local/bin/backup" >> "/home/steam/server/crontab"
fi

if [ "${AUTO_UPDATE_ENABLED}" = true ] && [ "${UPDATE_ON_BOOT}" = true ]; then
echo "AUTO_UPDATE_ENABLED=${AUTO_UPDATE_ENABLED}"
if [ "${AUTO_UPDATE_ENABLED,,}" = true ] && [ "${UPDATE_ON_BOOT}" = true ]; then
echo "AUTO_UPDATE_ENABLED=${AUTO_UPDATE_ENABLED,,}"
echo "$AUTO_UPDATE_CRON_EXPRESSION bash /usr/local/bin/update" >> "/home/steam/server/crontab"
fi

if { [ "${AUTO_UPDATE_ENABLED}" = true ] && [ "${UPDATE_ON_BOOT}" = true ]; } || [ "${BACKUP_ENABLED}" = true ]; then
if { [ "${AUTO_UPDATE_ENABLED,,}" = true ] && [ "${UPDATE_ON_BOOT,,}" = true ]; } || [ "${BACKUP_ENABLED,,}" = true ]; then
supercronic "/home/steam/server/crontab" &
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fi

if [ "$CURRENTBUILD" != "$TARGETBUILD" ]; then
echo "New Build was found. Updating the server from $CURRENTBUILD to $TARGETBUILD."
if [ "${RCON_ENABLED}" = true ]; then
if [ "${RCON_ENABLED,,}" = true ]; then
rm /palworld/steamapps/appmanifest_2394010.acf
rcon-cli -c /home/steam/server/rcon.yaml "broadcast The_Server_will_update_in_${AUTO_UPDATE_WARN_MINUTES}_Minutes"
sleep "${AUTO_UPDATE_WARN_MINUTES}m"
Expand Down