Forum

> > CS2D > Servers > Auto restart server in Shut down
ForenübersichtCS2D-Übersicht Servers-ÜbersichtEinloggen, um zu antworten

Englisch Auto restart server in Shut down

6 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Re: Auto restart server in Shut down

KimKat
GAME BANNED Off Offline

Zitieren
You can write a Bash script to check if the server is running and do a couple more checks with a socket check program to see if the server is online. If the server isn't online then re-launch the server. It's not that difficult to write in Bash all you really need is to learn AWK which is a basic Linux scripting language which can simplify things for you greatly. All it takes is just to learn it and you'll be good to go.

alt Re: Auto restart server in Shut down

TopNotch
User Off Offline

Zitieren
It's pretty easy if you know some Bash.
You can use this condition to determine whether a process is running or not (there are other ways though):
1
2
3
4
5
6
if ps aux | grep "CounterStrike2D.exe" > /dev/null
then
	echo "Running"
else
    echo "Stopped"
fi

alt Re: Auto restart server in Shut down

sheeL
User Off Offline

Zitieren
1 - Open your putty
2 - Type;

1
2
3
vi cron.sh
(paste the code)
Press CTRL + C (one time) and type :wq to save
3 - When you save, type on your terminal
1
chmod 755 cron.sh

It's a example for save the file and set the permissions, but @user TopNotch: script won't restart your server when crash, just an example.

alt Re: Auto restart server in Shut down

KimKat
GAME BANNED Off Offline

Zitieren
These scripts I've written are working pretty good.
Code >
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Servers-ÜbersichtCS2D-ÜbersichtForenübersicht