SRCDS on Linux scripts with auto updates, for Jabroni Brawl 3 dedicated server.
- Ubuntu Server 20.04/22.04
- Dedicated
steam
user - Everything is located in the steam user's home directory
- Install
screen
and whatever else is needed for a SRCDS (see references at the end)
start_jbep3.sh (insert your own IP, Steam account token and paths)
#!/bin/bash
cd /home/steam/.steam/steamcmd/jbep3_server
screen -dmS jbserver ./srcds_run.sh -game jbep3 -console -ip 12.34.xx.xx -port 27015 \
+map jb_killbox +maxplayers 24 +sv_lan 0 +jb_sv_gamemode deathmatch \
-sv_steamaccount ABCDEF1234 \
-autoupdate -steam_dir /home/steam/.steam/steamcmd/ -steamcmd_script /home/steam/srcds_autoupdate.txt
echo Started screen session "jbserver", use "screen -r jbserver" to attach back to it.
Parameter steamcmd_script
in above command points to this file for auto-updating. It is ran whenever the server is started or when an update becomes available during runtime.
srcds_autoupdate.txt
force_install_dir /home/steam/.steam/steamcmd/jbep3_server/
login anonymous
app_update 869800
quit
Sends quit
command to the SRCDS screen
.
stop_jbep3.sh
#!/bin/bash
echo Sending quit to screen
screen -S jbserver -X quit
echo Done
steamcmd +force_install_dir ./jbep3_server/ +login anonymous +app_update 869800 verify +quit
Since this server's sole purpose is to run the SRCDS, we can add a cronjob to start the server at boot. Also periodically restart the server (once a day).
SHELL=/bin/bash
@reboot sleep 60 && /home/steam/start_jbep3.sh
0 5 * * * /home/steam/stop_jbep3.sh && /home/steam/start_jbep3.sh
- Valve Developer Wiki: Command Line Options
- Steam Community: Jabroni Brawl: Episode 3 - The Dedicated Server Guide (by bld.dz)