Xonotic Forums
Convenient Xonotic Server Management Script - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Server Administration (https://forums.xonotic.org/forumdisplay.php?fid=16)
+--- Thread: Convenient Xonotic Server Management Script (/showthread.php?tid=2780)



Convenient Xonotic Server Management Script - Pricetx - 03-26-2012

NOTE: Make sure you have Bash and GNU Screen installed before you try using this, and that you adjust the directories to match your setup!

Introduction

I wrote this script to make life easier for myself when running my Xonotic server. It also allows me to easily expand to several servers should I wish to. It uses GNU Screen so that I can easily attach and detach from any servers i'm running.

Download

The script comes in two parts. A utility and a launcher for the server. Place both wherever you want. Make sure to edit the bottom line of xonoticlauncher.sh to point to xonotic-servertool.

http://dl.dropbox.com/u/39026936/xonotic-servertool

http://dl.dropbox.com/u/39026936/xonoticlauncher.sh

Configuration

xonotic-servertool is the main script. This handles starting, stopping, restarting, and showing the status of the server. You should NOT need to edit this file at any point unless you wish to improve on it's features.

xonoticlauncher.sh. This is the launching file for your server. You can have several of these for different servers if you wish.

Below is a key to what each line of this launcher does:

"NAME" = The name of the screen session.
"DESC" = The description for the screen session.
"DIR" = The directory which contains the xonotic-dedicated binary you are using.
"DAEMON" = The path to your xonotic-dedicated binary.
"PARAMS" = The paramers for starting the server, this is where you point it to your server configuration file.
"DATA" = This is the name of your dedicated server binary

The bottom line tells it where to look for the Xonotic server tool.

Usage:

To do something to the server. You will always run the xonoticlauncher.sh script with a command after it. To see a list of available commands run xonoticlauncher.sh on it's own.

To START the server, type xonoticlauncher.sh start
To STOP the server, type xonoticlauncher.sh stop
To RESTART the server, type xonoticlauncher.sh restart
To see the STATUS of the server, type xonoticlauncher.sh status

(NOTE: I'm planning to make status show the output of a status command on the console shortly).

When the server is running, you can attach to the screen session using:
screen -rS (NAME you put in xonoticlauncher.sh)
e.g. screen -rS xonotic

To detach from the screen session type:
Ctrl + A + D

- Pricetx.