Skip to content

Instantly share code, notes, and snippets.

@ringvold
Created March 11, 2020 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ringvold/90733fa258c271ed6b5d9deaa5456813 to your computer and use it in GitHub Desktop.
Save ringvold/90733fa258c271ed6b5d9deaa5456813 to your computer and use it in GitHub Desktop.
sudo dpkg --add-architecture i386; sudo apt update; sudo apt install mailutils postfix curl wget file tar bzip2 gzip unzip bsdmainutils python util-linux ca-certificates binutils bc jq tmux lib32gcc1 libstdc++6 libstdc++6:i386
wget -O linuxgsm.sh https://linuxgsm.sh && chmod +x linuxgsm.sh && bash linuxgsm.sh csgoserver
./csgoserver auto-install
echo "This script uses these environment variables \n that are to be set by the user: "
echo "- LGSM_SERVER_IP"
echo "- RCON_PASSWORD"
echo "- GSLT_TOKEN"
echo "- CSGO_SERVER_PASSWORD"
read -p "Have you set these variables? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
export LGSM_INSTANCE_CONFIG_FOLDER=/home/csgoserver/lgsm/config-lgsm/csgoserver
export LGSM_INSTANCE_CONFIG=$LGSM_INSTANCE_CONFIG_FOLDER/csgoserver.cfg
export GAMESERVER_CONFIG_FOLDER=/home/csgoserver/serverfiles/csgo/cfg/
export GAMESERVER_CONFIG=$GAMESERVER_CONFIG_FOLDER/csgoserver.cfg
cat $LGSM_INSTANCE_CONFIG_FOLDER/_default.cfg >> $LGSM_INSTANCE_CONFIG
echo "Changing default LGSM instance config"
echo " - Setting GSLT Token"
sed -i -e "/^gslt=/s/^.*$/gslt=\"$GSLT_TOKEN\"/" $LGSM_INSTANCE_CONFIG
echo " - Setting competitive gamemode"
sed -i -e "/^gamemode=/s/^.*$/gamemode=\"1\"/" $LGSM_INSTANCE_CONFIG
echo " - Setting IP address"
sed -i -e "/^ip=/s/^.*$/ip=\"$LGSM_SERVER_IP\"/" $LGSM_INSTANCE_CONFIG
echo " - Setting 128 tick rate"
sed -i -e "/^tickrate=/s/^.*$/tickrate=\"128\"/" $LGSM_INSTANCE_CONFIG
echo "Changing CSGO server config"
echo " - Setting server name"
sed -i -e "/^hostname/s/^.*$/hostname \"The Promised LAN\"/" $GAMESERVER_CONFIG
echo " - Setting rcon password"
sed -i -e "/^rcon_password/s/^.*$/rcon_password \"$RCON_PASSWORD\"/" $GAMESERVER_CONFIG
echo " - Setting server name"
sed -i -e "/^sv_password/s/^.*$/sv_password \"$CSGO_SERVER_PASSWORD\"/" $GAMESERVER_CONFIG
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment