mirror of
https://github.com/YuzuZensai/palworld-server-docker.git
synced 2026-01-06 04:32:43 +00:00
add option to enable rcon
This commit is contained in:
@@ -40,8 +40,29 @@ fi
|
||||
|
||||
cd /palworld || exit
|
||||
|
||||
echo "${STARTCOMMAND}"
|
||||
printf "\e[0;32m*****CHECKING FOR EXISTING CONFIG*****\e[0m\n"
|
||||
|
||||
if [ ! -f /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini ]; then
|
||||
|
||||
printf "\e[0;32m*****GENERATING CONFIG*****\e[0m\n"
|
||||
|
||||
# Server will generate all ini files after first run.
|
||||
su steam -c "timeout --preserve-status 15s ./PalServer.sh 1> /dev/null "
|
||||
|
||||
# Wait for shutdown
|
||||
sleep 5
|
||||
cp /palworld/DefaultPalWorldSettings.ini /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
|
||||
fi
|
||||
|
||||
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
|
||||
echo "RCON_PORT=${RCON_PORT}"
|
||||
sed -i "s/RCONPort=[0-9]*/RCONPort=$RCON_PORT/" /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
|
||||
fi
|
||||
|
||||
printf "\e[0;32m*****STARTING SERVER*****\e[0m\n"
|
||||
|
||||
echo "${STARTCOMMAND}"
|
||||
su steam -c "${STARTCOMMAND}"
|
||||
|
||||
Reference in New Issue
Block a user