Help - Search - Members - Calendar
Full Version: Script to restart the server auto?
The Planet Forums > System Administration > Game Hosting
Bogdan
Hi,
Im looking for a script to restart any of my CS servers when they go down.

I mean if you load a bad map the server goes down, but this script is able to restart it without me being thre.

I know the server can be crashed and impossible to auto restart without some other modifications...

Anyone knows where i can get such a script?
TexasFishingInfo.com
Windows or Linux?

In Windows, a performance monitor counter set to run a specified program if a certain threshold is reached. There's a resource kit tool called shutdown.

Shutdown /L /R will shutdown and reboot the local machine. You can also set the time, because I think it waits 15mins by default.

However, you'll have to give it a parameter to watch. Of course, if you're just wanting to restart IIS, you can run iisreset.

Linux is foreign to me at present.
FarCry
Texas... i think that was kinda irrelevant, hes talking about CS not IIS icon_razz.gif

It should automaticaly restart on linux, after 10 seconds.

On windows you could create a batch file with an infinite loop around the command to start the server, eg:

@echo off
:start
... code to run cs ...
goto start
Bogdan
Im looking at linux here.

So it does it auto?

Never knew that but i guess thats a great thing icon_smile.gif

Thanks guys
FarCry
just look at the code, its a loop icon_smile.gif
xShijimax
I know this topic is really old but can anyone figure out this loop for me...yes it works....but I want it to restart atleast 6 different programs...and have it restart all 3 if any of them go down...with a wait timer also of like 5 seconds if possible
klaude
QUOTE (xShijimax)
I know this topic is really old but can anyone figure out this loop for me...yes it works....but I want it to   restart atleast 6 different programs...and have it restart all 3 if any of them go down...with a wait timer also of like 5 seconds if possible


If thats the case you should make a loop that checks to see if the programs are running. If any of them arent then kill and restart their processes before going to the next iteration. You'll definately want a wait timer of 5 or 10 seconds inbetween iterations so your script won't bog the system down.
FluX
Hello I noticed your little forum topic, so I was wondering if you could help me with this auto start your talking about.

I have a server and sometimes im not always able to look out for it, so I was told about this auto start you could setup.

Now how would I set that up.

My CS 1.6 Server is Stand Alone.
You said something about a batch file, first how do I create the file to edit it and add the code. Second were do I place it, and do I have to do anything else?

Thanks so much in advacned
-Kitami
FluX
With some research I was able to create the file and insert the code. Now I put in the code to start the server but it brings it to the setup screen were u press Start Server, is there any way I can make it start the server also? like is there a code for that?
fpscops.com
post you code, I'll see if I can help you.
FluX
@echo off
:start
D:CServcerhlds.exe
goto start
fpscops.com
you should add the code below to the end of your executing path:

CODE
-console -game dmc -port 27015 +exec server.cfg +maxplayers 16 +map dmc_seige



adjust that to suit your scenario.
FluX
since, i got it 2 work im happy.
Now if anyone else needs help ill gladly show them to the way.
Cs code is
@echo off
:start
D:CServcerhlds.exe -console -game cstrike -port 27015 +exec server.cfg +maxplayers 24 +map cs_assault
goto start
fpscops.com
Your welcome. icon_cool.gif
FluX
yea sorry was just so happy, was reloading all my mods lolz.
Thanks so much. icon_twisted.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.