Raised This Month: $ Target: $400
 0% 

[]Linux[] The easier way to update sourcemod on a lot of servers.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Pitbull3
AlliedModders Donor
Join Date: Aug 2009
Location: Degree-Gaming.com
Old 10-07-2016 , 11:18   []Linux[] The easier way to update sourcemod on a lot of servers.
Reply With Quote #1

I run a lot of servers, and when it comes to updating sourcemod it was really a drag... no literally, drag & drop 50 times. So I created an easy way a while back to update servers via linux & wanted to post it here for any other linux server owners to be able to update their servers SM installs quicker and easier.

This can be edited to do whatever you want it to do, and any version of sourcemod you want to run, for example I'll be using my "csgo" SM updater as we run the newest versions of SM 1.8 on our CSGO servers but some of our TF2 servers run 1.7, so modify it as you will.

We're removing all of the files that you don't want overwritten before we copy them to our SM directories. Such as the CFG folder, admin_*.cfg's & databases.cfg, ect,ect... this way we're just updating SM & not overwriting your edited files. (That would suck!)

To change the SM version just edit the line: wget -O smcsgoupdate.tar.gz 'http://sourcemod.net/latest.php?version=1.8&os=linux' & change the version=1.8 to whatever version you want.

Steps:

1.) Create a file "smcsgoupdate" doesn't need an extension as we'll be using ./smcsgoupdate to run it.
2.) Copy the contents of the following code into that file.

Code:
#!/bin/bash
cd /home/updaters
rm -rf /home/updaters/smcsgoupdate/csgo/*
rm /home/updaters/smcsgoupdate.tar.gz
wget -O smcsgoupdate.tar.gz 'http://sourcemod.net/latest.php?version=1.8&os=linux'
tar zxvf smcsgoupdate.tar.gz -C /home/updaters/smcsgoupdate/csgo
rm -rf /home/updaters/smcsgoupdate/csgo/cfg
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/admin_groups.cfg
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/admin_levels.cfg
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/admin_overrides.cfg
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/adminmenu_cfgs.txt
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/adminmenu_custom.txt
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/adminmenu_grouping.txt
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/adminmenu_sorting.txt
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/admins.cfg
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/admins_simple.ini
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/banreasons.txt
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/databases.cfg
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/configs/maplists.cfg
rm -rf /home/updaters/smcsgoupdate/csgo/addons/sourcemod/logs
rm -rf /home/updaters/smcsgoupdate/csgo/addons/sourcemod/data
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/GPLv2.txt
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/GPLv3.txt
rm /home/updaters/smcsgoupdate/csgo/addons/sourcemod/LICENSE.txt
cp -R /home/updaters/smcsgoupdate/csgo /home/gameservers/csgo
cp -R /home/updaters/smcsgoupdate/csgo/addons/sourcemod/* /home/gameservers/csgo/csgo/addons/sourcemodforkedservername

3.) I recommend after editing the file & saving / uploading it you run dos2unix smcsgoupdate to fix any windows/dos text editing invisible character codes that may break the file. You can install dos2unix easily, yum install dos2unix / apt-get install dos2unix. Info on dos2unix http://dos2unix.sourceforge.net/
4.) After you've edited your paths correctly to your servers run the file ./smcsgoupdate


There's multiple ways you can do this, if you run regular server-by-server in their own folders edit the line accordingly:

cp -R /home/updaters/smcsgoupdate/csgo /home/gameservers/csgo
cp -R /home/updaters/smcsgoupdate/csgo /home/gameservers/csgo2
cp -R /home/updaters/smcsgoupdate/csgo /home/gameservers/csgo3

ect..

If you run forked SM servers edit the lines accordingly:

cp -R /home/updaters/smcsgoupdate/csgo/addons/sourcemod/* /home/gameservers/csgo/csgo/addons/sourcemodforkedservername
cp -R /home/updaters/smcsgoupdate/csgo/addons/sourcemod/* /home/gameservers/csgo/csgo/addons/sourcemodforkedservernam2
cp -R /home/updaters/smcsgoupdate/csgo/addons/sourcemod/* /home/gameservers/csgo/csgo/addons/sourcemodforkedservernam3

Last edited by Pitbull3; 10-07-2016 at 11:36.
Pitbull3 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:37.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode