Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Garry's Mod Installation Script
- #
- # Server Files: /mnt/server
- apt -y update
- apt -y --no-install-recommends install curl lib32gcc1 ca-certificates
- cd /tmp
- curl -sSL -o steamcmd.tar.gz http://media.steampowered.com/installer/steamcmd_linux.tar.gz
- mkdir -p /mnt/server/steamcmd
- tar -xzvf steamcmd.tar.gz -C /mnt/server/steamcmd
- cd /mnt/server/steamcmd
- # SteamCMD fails otherwise for some reason, even running as root.
- # This is changed at the end of the install process anyways.
- chown -R root:root /mnt
- export HOME=/mnt/server
- ./steamcmd.sh +login anonymous +force_install_dir /mnt/server +app_update 4020 +quit
- mkdir -p /mnt/server/.steam/sdk32
- cp -v linux32/steamclient.so ../.steam/sdk32/steamclient.so
- # Installing CSS
- cd /mnt/server
- curl -O https://www.rebootservers.com/resources/cstrike.tar.gz
- tar -xzvf cstrike.tar.gz
- # Creating needed default files for the game
- cd /mnt/server/garrysmod/lua/autorun/server
- echo '
- -- Docs: https://wiki.garrysmod.com/page/resource/AddWorkshop
- -- Place the ID of the workshop addon you want to be downloaded to people who join your server, not the collection ID
- -- Use https://beta.configcreator.com/create/gmod/resources.lua to easily create a list based on your collection ID
- resource.AddWorkshop( "" )
- ' > workshop.lua
- cd /mnt/server/garrysmod/cfg
- echo '
- // Please do not set RCon in here, use the startup parameters.
- hostname "New Gmod Server"
- sv_password ""
- sv_loadingurl ""
- // Steam Server List Settings
- sv_region "255"
- sv_lan "0"
- sv_max_queries_sec_global "30000"
- sv_max_queries_window "45"
- sv_max_queries_sec "5"
- // Server Limits
- sbox_maxprops 100
- sbox_maxragdolls 5
- sbox_maxnpcs 10
- sbox_maxballoons 10
- sbox_maxeffects 10
- sbox_maxdynamite 10
- sbox_maxlamps 10
- sbox_maxthrusters 10
- sbox_maxwheels 10
- sbox_maxhoverballs 10
- sbox_maxvehicles 20
- sbox_maxbuttons 10
- sbox_maxsents 20
- sbox_maxemitters 5
- sbox_godmode 0
- sbox_noclip 0
- // Network Settings - Please keep these set to default.
- sv_minrate 75000
- sv_maxrate 0
- gmod_physiterations 2
- net_splitpacket_maxrate 45000
- decalfrequency 12
- // Execute Ban Files - Please do not edit
- exec banned_ip.cfg
- exec banned_user.cfg
- // Add custom lines under here
- ' > server.cfg
- echo '
- //
- // Use this file to mount additional paths to the filesystem
- // DO NOT add a slash to the end of the filename
- //
- "mountcfg"
- {
- "cstrike" "/home/container/cstrike"
- // "tf" "C:\mytf2server\tf"
- }
- ' > mount.cfg
- # Cleanup
- cd /mnt/server
- rm cstrike.tar.gz
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement