Posts: 4
Threads: 2
Joined: Oct 2007
Reputation:
0
Hello,
there is a script for restarting server in 10 seconds when a user say quit on console?
I use the screen
thanks
Posts: 2,270
Threads: 45
Joined: May 2007
Reputation:
11
What? What do you mean by the "screen?" Are you asking is there a script?
realchamp Wrote:Hazz Wrote:Has someone helped you on these forums? If so, help someone else
Mooga Wrote:OrangeBox is a WHORE.
Posts: 94
Threads: 10
Joined: Jan 2007
Reputation:
0
if u have the -autoupdate in the start up line it restarts with the command quit
Posts: 36
Threads: 4
Joined: Oct 2007
Reputation:
0
I just type 'ps -ejH' to find the process and then 'sudo kill <screenPID>' This is in Ubuntu 7.10.
Posts: 6
Threads: 1
Joined: Oct 2007
Reputation:
0
simply rcon quit in console
Posts: 116
Threads: 16
Joined: Sep 2007
Reputation:
0
SRCDS is built so that if a 'quit' command is sent, it will automatically restart the server in 10 seconds - no matter if its run in a screen or not.
hmm mine doesnt do that :[
fedora 6
Posts: 483
Threads: 9
Joined: Mar 2007
Reputation:
0
if you have -autoupdate in the launch parameters it should.
Posts: 47
Threads: 5
Joined: Nov 2007
Reputation:
0
02-19-2008, 08:31 AM
(This post was last modified: 02-19-2008, 08:33 AM by deviantlinux.)
Even with -autoupdate in the parameters, it will take a while to restart since it checks for updates etc. For a game server provider or a serious server setup, a loop would be the best idea. This will restart your server instantly, and you will find it back up after a crash or rcon quit within around 1-2 seconds. This is the same idea as the Windows Batch restart script.
#!/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 -d -m -S $SCREEN_NAME ./srcds_run -game cstrike +map de_dust -secure +maxplayers 12
fi
done