0


PalWorld/幻兽帕鲁Ubuntu 22.04 LTS 一键部署脚本

上去就是干!

创建install.sh文件

#!/bin/bashsteam_user=steam
log_path=/tmp/pal_server.log

if getent passwd"$steam_user">/dev/null 2>&1;thenecho"User $steam_user exists."elseecho"User $steam_user does not exist.Adding $steam_user ..."sudouseradd -m -s /bin/bash $steam_userfiecho"Installing SteamCMD..."sudo add-apt-repository multiverse -y >$log_pathsudo dpkg --add-architecture i386 >>$log_pathsudoapt-get update -y >>$log_pathsudoapt-get remove needrestart -y >>$log_pathecho steam steam/license note ''|sudo debconf-set-selections 
echo steam steam/question select"I AGREE"|sudo debconf-set-selections 
sudoapt-getinstall steamcmd -y >>$log_pathsteam_user_path=~steam
steamcmd_path=$(whereis steamcmd|awk'{print $2}')sudo -u $steam_usermkdir -p $steam_user_path/.steam/sdk64/ >>$log_pathecho"Downloading palServer..."sudo -u $steam_user$steamcmd_path +login anonymous +app_update 1007 validate +quit >>$log_pathsudo -u $steam_user$steamcmd_path +login anonymous +app_update 2394010 validate +quit >>$log_pathsudocp$steam_user_path/Steam/steamapps/common/Steamworks\ SDK\ Redist/linux64/steamclient.so $steam_user_path/.steam/sdk64/

systemd_unit=pal-server
cat<<EOF>$systemd_unit.service
[Unit]
Description=$systemd_unit.service

[Service]
Type=simple
User=$steam_user
Restart=on-failure
RestartSec=30s
ExecStart=$steam_user_path/Steam/steamapps/common/PalServer/PalServer.sh -useperfthreads -NoAsyncLoadingThread -UseMultithreadForDS

[Install]
WantedBy=multi-user.target
EOFsudomv$systemd_unit.service /usr/lib/systemd/system/
echo"Starting palServer..."sudo systemctl enable$systemd_unitsudo systemctl restart $systemd_unitsudo systemctl -l --no-pager status $systemd_unitif systemctl --quiet is-active "$systemd_unit"thenecho -e "\nPalServer is running successfully, enjoy!"elseecho -e "\nThere were some problems with the installation, please check the log $log_path."fi

执行install.sh文件

bash install.sh

设置默认配置文件

steam_user=steam
steam_user_path=~steam
steamcmd_path=$(whereis steamcmd|awk'{print $2}')sudochmod777 /home/steam/Steam/steamapps/common/PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini 
sudocp$steam_user_path/Steam/steamapps/common/PalServer/DefaultPalWorldSettings.ini $steam_user_path/Steam/steamapps/common/PalServer/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini
systemctl restart pal-server
标签: ubuntu 服务器 linux

本文转载自: https://blog.csdn.net/fly1574/article/details/135866720
版权归原作者 指剑 所有, 如有侵权,请联系我们删除。

“PalWorld/幻兽帕鲁Ubuntu 22.04 LTS 一键部署脚本”的评论:

还没有评论