Raised This Month: $32 Target: $400
 8% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
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
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-08-2016 , 03:26   Re: []Linux[] The easier way to update sourcemod on a lot of servers.
Reply With Quote #2

Well, upgrading SM, you don't need worry server configs and settings,
if you just upload these folders

bin
extensions
gamedata
translations

...and overwrite files.
And to make sure all files get overwritten, server need to be shutdown or mm:s unloaded. At least on OS Windows.
__________________
Do not Private Message @me
Bacardi is offline
Pitbull3
AlliedModders Donor
Join Date: Aug 2009
Location: Degree-Gaming.com
Old 10-09-2016 , 08:13   Re: []Linux[] The easier way to update sourcemod on a lot of servers.
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
Well, upgrading SM, you don't need worry server configs and settings,
if you just upload these folders

bin
extensions
gamedata
translations

...and overwrite files.
And to make sure all files get overwritten, server need to be shutdown or mm:s unloaded. At least on OS Windows.
Yea this is for linux, since you don't need to shutdown the servers as you can overwrite "in-use" files, once sourcemod's extensions get overwritten the server will auto-restart.

You do need to update the plugins folder as from time to time they update the base SM plugins as well.
Pitbull3 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-09-2016 , 08:32   Re: []Linux[] The easier way to update sourcemod on a lot of servers.
Reply With Quote #4

Yea, you're right, I forget that folder.
Bacardi is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-09-2016 , 19:37   Re: []Linux[] The easier way to update sourcemod on a lot of servers.
Reply With Quote #5

Quote:
Originally Posted by Pitbull3 View Post
Yea this is for linux, since you don't need to shutdown the servers as you can overwrite "in-use" files, once sourcemod's extensions get overwritten the server will auto-restart.

You do need to update the plugins folder as from time to time they update the base SM plugins as well.
The server will almost certainly crash during the process.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Pitbull3
AlliedModders Donor
Join Date: Aug 2009
Location: Degree-Gaming.com
Old 10-12-2016 , 23:18   Re: []Linux[] The easier way to update sourcemod on a lot of servers.
Reply With Quote #6

Quote:
Originally Posted by Powerlord View Post
The server will almost certainly crash during the process.

"the server will auto-restart."
Pitbull3 is offline
B3none
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 07-22-2018 , 07:52   Re: []Linux[] The easier way to update sourcemod on a lot of servers.
Reply With Quote #7

Super useful, thanks.
__________________
B3none is offline
Reply



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 13:29.


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