This is a lightweight Garry's Mod Linux dedicated server management script.
It is intended for users with some basic Linux experience.
The program screen is used to run the GMod server in a separate session (meaning you can log out without the server stopping).
- sudo apt-get install steamcmd
- sudo apt-get install screen
./server.sh start|stop|update|generate-config
cd /path/to/my/gmod/server
curl https://raw.githubusercontent.com/BadgerCode/gmod-server-scripts/master/server.sh?$(date +%s) > server.sh
chmod u+x server.sh
./server.sh generate-config
./server.sh update
./server.sh start
After installation
- bin
- css-mount
- garrysmod
- platform
- server.sh
- sourceengine
- srcds_linux
- srcds_run
- steamapps
Open up config.sh and look at the configuration section near the top.
Important: Make sure to stop your server before changing config.sh.
Use the command
screen -ls
and look for your SERVERNAME (set in config.sh).
- https://developer.valvesoftware.com/wiki/SteamCMD
- Change "STEAMCMD" in config.sh to the location of your SteamCmd (e.g. "/home/me/steamcmd/steamcmd.sh")
crontab -e
- Add a new line at the bottom:
@reboot /full/path/to/server.sh start
This script just updates/installs CSS. You have to tell the GMod server to use it.
- https://wiki.garrysmod.com/page/Mounting_Content_on_a_DS (or google "garrymod mount")
- The location of your CSS files is in the variable CSSMOUNTPATH
Example
Server location: "/home/badger/gmod-test-server"
...
CSSMOUNTPATH="$GMODSERVERPATH/css-mount"
Therefore, CSS files path is /home/badger/gmod-test-server/css-mount
Stop the server during this.
cd /path/to/my/gmod/server
curl https://raw.githubusercontent.com/BadgerCode/gmod-server-scripts/master/server.sh?$(date +%s) > server.sh
chmod u+x server.sh