SRCDS Steam group


Restart server script
#1
Hey.

I search a script, that can auto restart my server when it get crashed..

Example: My server say: Connection Problem. Then my server have to restart it selves.

Sry for my bad english.. Big Grin


And btw... I'm new at linux. It must be a very easy script Smile
Reply
#2
server_xyz.sh
[code]#!/bin/bash
#test if you are root, when true exit
[[ "`whoami`" = "root" ]] && echo "Don't run your Server as root!" && exit

#change directory to your server, don't forget orangebox
cd /home/server_xyz/orangebox
screen -mdS server_xyz ./srcds_run -autoupdate -ip xxx.xxx.xxx.xxx -port 270xx -game cstrike -maxplayers 12 +map de_dust
[code]

chmod u+x server_xyz.sh

./server_xyz.sh

The script doesn't check if your Server is already running.
The option -autoupdate restarts the Server, when your server ist restarted via quit or crashed.
The check if your server is running, makes the script a little bit bigger.

You can find an complex script at: http://sourceserver.info/wiki/installation/dedicated_server_standalone/script

The description is in german, but i've written the script in english. This script works with config files. You only need to edit the configfiles in startscript, for your server(s). In next version i will fix a little Bug, with the status command in the script. The command calls an old function, which I've deleted.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)