SRCDS Steam group


Two install hacks(scripts)
#1
Since im managing more and more servers, I decided to script up my install procedure. I use symlinks for the server, and do fresh install of smaller parts. Overall this is really really simple, however its alot of commands to enter Toungue.

steam-install. Installs a set list of games. This needs to be run for a fresh install, and after the link script. I didnt include the wget for steam, or hldupdate. Those arent that hard. It needs to be run after the link script for simple files, like the cfg files, top level txt files etc.
Code:
#!/bin/bash

steam="/home/srcd/steam"
target="/home/srcd/server"
$steam -command update -game tf -dir $target
$steam -command update -game insurgency -dir $target
$steam -command update -game "Counter-Strike Source" -dir $target
$steam -command update -game dods -dir $target
$steam -command update -game tfc -dir $target
$steam -command update -game dod -dir $target
$steam -command update -game synergy -dir $target
$steam -command update -game zps -dir $target
$steam -command update -game diprip -dir $target
$steam -command update -game redorchestra -dir $target
$steam -command update -game garrysmod -dir $target
$steam -command update -game dystopia -dir $target
$steam -command update -game insurgency -dir $target
$steam -command update -game esmod -dir $target
$steam -command update -game left4dead -dir $target

Link, this is too simply symlink all the files together. Yes i know, steam-install will automatically create some of these directories, i just like to do it for the sake of things.
Code:
#!/bin/bash
source="/home/srcd/server"
target="/home/srcd/server2"

mkdir -p $target/cstrike
mkdir -p $target/insurgency
mkdir -p $target/orangebox
mkdir -p $target/orangebox/tf
mkdir -p $target/orangebox/dod
mkdir -p $target/orangebox/tf/cfg
mkdir -p $target/orangebox/tf/addons
mkdir -p $target/orangebox/dod/cfg
mkdir -p $target/orangebox/dod/addons
mkdir -p $target/orangebox/zps/cfg
mkdir -p $target/orangebox/zps/addons
mkdir -p $target/orangebox/synergy/cfg
mkdir -p $target/orangebox/synergy/addons
mkdir -p $target/orangebox/diprip/cfg
mkdir -p $target/orangebox/diprip/addons
mkdir -p $target/valve

ln -s $source/hl2 $target/hl2
ln -s $source/bin $target/bin
ln -s $source/insurgency/shaders $target/insurgency/shaders
ln -s $source/insurgency/materials $target/insurgency/materials
ln -s $source/insurgency/music $target/insurgency/music
ln -s $source/insurgency/models $target/insurgency/models
ln -s $source/insurgency/sound $target/insurgency/sound
ln -s $source/insurgency/bin $target/insurgency/bin
ln -s $source/insurgency/resource $target/insurgency/resource
ln -s $source/insurgency/scripts $target/insurgency/scripts
ln -s $source/insurgency/maps $target/insurgency/maps
ln -s $source/insurgency/maps $target/insurgency/maps
ln -s $source/insurgency/mapsrc $target/insurgency/mapsrc
ln -s $source/insurgency/downloads $target/insurgency/downloads
ln -s $source/insurgency/DownloadLists $target/insurgency/DownloadLists

ln -s $source/cstrike/shaders $target/cstrike/shaders
ln -s $source/cstrike/materials $target/cstrike/materials
ln -s $source/cstrike/music $target/cstrike/music
ln -s $source/cstrike/models $target/cstrike/models
ln -s $source/cstrike/sound $target/cstrike/sound
ln -s $source/cstrike/bin $target/cstrike/bin
ln -s $source/cstrike/resource $target/cstrike/resource
ln -s $source/cstrike/scripts $target/cstrike/scripts
ln -s $source/cstrike/maps $target/cstrike/maps
ln -s $source/cstrike/maps $target/cstrike/maps
ln -s $source/cstrike/mapsrc $target/cstrike/mapsrc
ln -s $source/cstrike/downloads $target/cstrike/downloads
ln -s $source/cstrike/DownloadLists $target/cstrike/DownloadLists

ln -s $source/orangebox/tf/shaders $target/orangebox/tf/shaders
ln -s $source/orangebox/tf/materials $target/orangebox/tf/materials
ln -s $source/orangebox/tf/music $target/orangebox/tf/music
ln -s $source/orangebox/tf/models $target/orangebox/tf/models
ln -s $source/orangebox/tf/sound $target/orangebox/tf/sound
ln -s $source/orangebox/tf/bin $target/orangebox/tf/bin
ln -s $source/orangebox/tf/resource $target/orangebox/tf/resource
ln -s $source/orangebox/tf/scripts $target/orangebox/tf/scripts
ln -s $source/orangebox/tf/maps $target/orangebox/tf/maps
ln -s $source/orangebox/tf/maps $target/orangebox/tf/maps
ln -s $source/orangebox/tf/mapsrc $target/orangebox/tf/mapsrc
ln -s $source/orangebox/tf/downloads $target/orangebox/tf/downloads
ln -s $source/orangebox/tf/DownloadLists $target/orangebox/tf/DownloadLists

ln -s $source/orangebox/dod/shaders $target/orangebox/dod/shaders
ln -s $source/orangebox/dod/materials $target/orangebox/dod/materials
ln -s $source/orangebox/dod/music $target/orangebox/dod/music
ln -s $source/orangebox/dod/models $target/orangebox/dod/models
ln -s $source/orangebox/dod/sound $target/orangebox/dod/sound
ln -s $source/orangebox/dod/bin $target/orangebox/dod/bin
ln -s $source/orangebox/dod/resource $target/orangebox/dod/resource
ln -s $source/orangebox/dod/scripts $target/orangebox/dod/scripts
ln -s $source/orangebox/dod/maps $target/orangebox/dod/maps
ln -s $source/orangebox/dod/maps $target/orangebox/dod/maps
ln -s $source/orangebox/dod/mapsrc $target/orangebox/dod/mapsrc
ln -s $source/orangebox/dod/downloads $target/orangebox/dod/downloads
ln -s $source/orangebox/dod/DownloadLists $target/orangebox/dod/DownloadLists

ln -s $source/valve/sprites $target/valve/sprites
ln -s $source/valve/sound $target/valve/sound
ln -s $source/valve/scripts $target/valve/scripts
ln -s $source/valve/models $target/valve/models
ln -s $source/valve/maps $target/valve/maps
ln -s $source/valve/gfx $target/valve/gfx
ln -s $source/valve/events $target/valve/events
ln -s $source/valve/dlls $target/valve/dlls
ln -s $source/valve/cl_dlls $target/valve/cl_dlls

ln -s $source/orangebox/zps/shaders $target/orangebox/zps/shaders
ln -s $source/orangebox/zps/materials $target/orangebox/zps/materials
ln -s $source/orangebox/zps/music $target/orangebox/zps/music
ln -s $source/orangebox/zps/models $target/orangebox/zps/models
ln -s $source/orangebox/zps/sound $target/orangebox/zps/sound
ln -s $source/orangebox/zps/bin $target/orangebox/zps/bin
ln -s $source/orangebox/zps/resource $target/orangebox/zps/resource
ln -s $source/orangebox/zps/scripts $target/orangebox/zps/scripts
ln -s $source/orangebox/zps/maps $target/orangebox/zps/maps
ln -s $source/orangebox/zps/maps $target/orangebox/zps/maps
ln -s $source/orangebox/zps/mapsrc $target/orangebox/zps/mapsrc
ln -s $source/orangebox/zps/downloads $target/orangebox/zps/downloads
ln -s $source/orangebox/zps/DownloadLists $target/orangebox/zps/DownloadLists

ln -s $source/orangebox/synergy/shaders $target/orangebox/synergy/shaders
ln -s $source/orangebox/synergy/materials $target/orangebox/synergy/materials
ln -s $source/orangebox/synergy/music $target/orangebox/synergy/music
ln -s $source/orangebox/synergy/models $target/orangebox/synergy/models
ln -s $source/orangebox/synergy/sound $target/orangebox/synergy/sound
ln -s $source/orangebox/synergy/bin $target/orangebox/synergy/bin
ln -s $source/orangebox/synergy/resource $target/orangebox/synergy/resource
ln -s $source/orangebox/synergy/scripts $target/orangebox/synergy/scripts
ln -s $source/orangebox/synergy/maps $target/orangebox/synergy/maps
ln -s $source/orangebox/synergy/maps $target/orangebox/synergy/maps
ln -s $source/orangebox/synergy/mapsrc $target/orangebox/synergy/mapsrc
ln -s $source/orangebox/synergy/downloads $target/orangebox/synergy/downloads
ln -s $source/orangebox/synergy/DownloadLists $target/orangebox/synergy/DownloadLists

ln -s $source/orangebox/diprip/shaders $target/orangebox/diprip/shaders
ln -s $source/orangebox/diprip/materials $target/orangebox/diprip/materials
ln -s $source/orangebox/diprip/music $target/orangebox/diprip/music
ln -s $source/orangebox/diprip/models $target/orangebox/diprip/models
ln -s $source/orangebox/diprip/sound $target/orangebox/diprip/sound
ln -s $source/orangebox/diprip/bin $target/orangebox/diprip/bin
ln -s $source/orangebox/diprip/resource $target/orangebox/diprip/resource
ln -s $source/orangebox/diprip/scripts $target/orangebox/diprip/scripts
ln -s $source/orangebox/diprip/maps $target/orangebox/diprip/maps
ln -s $source/orangebox/diprip/maps $target/orangebox/diprip/maps
ln -s $source/orangebox/diprip/mapsrc $target/orangebox/diprip/mapsrc
ln -s $source/orangebox/diprip/downloads $target/orangebox/diprip/downloads
ln -s $source/orangebox/diprip/DownloadLists $target/orangebox/diprip/DownloadLists


Simply edit the source and target paths to your paths. Yes i know this can be done more elegantly, and done better, however this was a quick hack i did in like 10 minutes.

I have ~10 servers total running off symlinks and they run fine. Im looking into unionfs as well but this works for now
Reply
#2
this is a little overdone... it probably can be made with a less than 10 line script using find ;-)

but i agree, symlinking the servers is a good idea, i am doing this as well. it eases the updates a lot and can also be used to "sync" configurations between similar servers and making backups only of important files.
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#3
symlinks are great. can be done with
cp -s -R $source/* $target

http://forums.srcds.com/viewpost/45080#pid45080
"the box said 'requires windows xp or better'. so i installed linux"
Linux Ubuntu 9.04 Server 2.6.30-vanilla #1 SMP PREEMPT x86_64
Reply
#4
I didnt know you could cp symlinks. Like i said quick hack done in a couple of minutes. Figured id post it in case anyone else could us it. It was really hackish, i just used nano find and replace instances.
Reply
#5
oh, janne, thats even easier than find, I did not though of this ;-)
http://www.fpsmeter.org
http://wiki.fragaholics.de/index.php/EN:Linux_Optimization_Guide (Linux Kernel HOWTO!)
Do not ask technical questions via PM!
Reply
#6
Hmm....

I'll keep seperate servers and just do mount --bind for maps folder only thanks Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)