SRCDS Steam group


easy & simple (re-)startscript
#1
hi,

can I use the following lines within an already running .sh-script (monitored by /etc/crontab) as kinda startscript that also brings the server back on crash?

if pidof srcds_i686; then
echo srcds laeuft noch
else
cd /home/gameserver/servers/xxx/halflife2
/usr/bin/screen -A -m -d -S server ./srcds_run -game cstrike -ip xxx -port 27015 -tickrate 100 +fps_max 0 +map de_piranesi -maxplayers 35 &
fi

I mean it works and the server comes back after a crash as well -
but I'm just asking because all other startscripts I've seen are much longer and bigger than this. or is there any reason why I should NOT do so as described above?
Reply
#2
I don't see any obvious reason why this should not work. Just try it out.
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
thank you BE! yep, works great ... I was asking coz this is so simple while other startup-scripts are much longer/huger.

and it even brings your server back on crash - so if anyone was looking for a small (re-)startscript that brings your server online without entering any command after crash or root-reboot, feel free to take the one above (and modify it depending on your game/configuration) Smile
Reply
#4
The reason why other scripts are bigger is because they generally monitor a specific process. This script would only work if your running a singular instance of the server.
Reply
#5
(02-19-2010, 09:48 PM)skeletor Wrote:  The reason why other scripts are bigger is because they generally monitor a specific process. This script would only work if your running a singular instance of the server.

... and that's what I'm doing, so this works for me. also, I don't need any monitoring functionalities.
Reply
#6
If you want to run it for more than instance, check for the screentab instead of the process

Code:
if [[ `screen -ls |grep screenname` ]]
   then
       echo "running"
   else
    cd /home/gameserver/servers/xxx/halflife2
    /usr/bin/screen -A -m -d -S screenname ./srcds_run -game cstrike -ip xxx -port 27015 -tickrate 100 +fps_max 0 +map de_piranesi -maxplayers 35
   fi
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)