SRCDS Steam group


Srcds linux auto-restart script
#1
I have found some scripts to auto-restart when server crashes or you use rcon quit, like this script: *****forums.steampowered.com/forums/showpost.php?p=6480002&postcount=7, but that scripts doesn't work any more.
Reply
#2
Linux servers already do have Auto-Restart...
Reply
#3
(11-15-2010, 01:42 PM)Hovercat Wrote: Linux servers already do have Auto-Restart...

That when the server crashes, but if i use quit or exit command in console, the server shutdown.
Oh I found it, this is the script for anybody who want to use quit or exit to restart your server

Step 1.
Code:
#!/bin/bash # Restart script by devianTlinux SCREEN_NAME="Set your screen name here" count=1 while [ $count ] do # If no screen under that name was found... if [[ `screen -ls | grep $SCREEN_NAME` == "" ]] then # Nothing was found running ; restart the server. cd /your/srcds/dir/ ; screen -A -d -m -S $SCREEN_NAME ./srcds_run -game cstrike +map de_dust -secure +maxplayers 12 fi done

Edit this script and save as run.sh, chmod +x run.sh
2. Use this command: screen -A -d -m -S run ./run.sh
Reply
#4
I'm pretty sure that if you run the srcds_run script, it will have auto restart.
Reply
#5
(11-15-2010, 10:14 PM)Hovercat Wrote: I'm pretty sure that if you run the srcds_run script, it will have auto restart.
I have tried, when i use "rcon quit" it said server shutdown Smile
Reply
#6
You could make a shell script with something like:
Code:
if ["netstat -a | grep 27015" == "*:27015"]; then ./server.sh else echo "No shit to do LOL!" fi
And then put it in a cron job to run every 5 minutes. Im not sure, but it could be... Wink
SlÄ den med jeres fiberforbindelser...

[IMG]*****www.speedtest.net/result/1308107839.png[/IMG]
Reply
#7
(11-15-2010, 11:23 PM)duydangle Wrote:
(11-15-2010, 10:14 PM)Hovercat Wrote: I'm pretty sure that if you run the srcds_run script, it will have auto restart.
I have tried, when i use "rcon quit" it said server shutdown Smile

Have you tried adding "-autoupdate" to the startup line? I believe that does have an effect on restarting.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)