1 (edited by Alkali 2012-03-19 20:15:07)

Topic: Linux - Teeworlds Server Scripts

Linux - Teeworlds Server Scripts

- Easy to install and set up
- Easy to use
- Multiple server support
- Clean starting, stopping and restarting of all or only a single server
- Automatic server restart on crash or "shutdown"
- Automatic server start on system boot (in case system reboots or restarts after a crash)
- Script update function
- Very resource friendly

Compability: 0.5 trunk
                   0.6.0
                   0.6.1
                   0.6 trunk

This script uses Linux Shell.

Works guranteed on Debian and Ubuntu, but probably also works on other Linux OS.

Downloads:
Install.sh
Teeworlds.tar.gz
Compability Downloads: Did you get syntax errors when executing the scripts? Try these!
Install.sh
Teeworlds.tar.gz


How to install using install.sh (Might only work on Debian and Ubuntu)
1. Login as root and type following command into the console:
aptitude install wget tar nohup
2. Create a new user using adduser or useradd
3. Login to the new account and go into the directory, that you want your Teeworlds servers to be installed in
4. Type following commands into the console:
wget http://95.156.208.254/files/normal/install.sh
chmod 744 install.sh
5. Execute install.sh and follow the instructions:
sh install.sh install
6. Go into the Teeworlds directory, then srvfiles and edit the storage.cfg
Read the comments and edit the bottom two add_path


How to install manually (Advanced)
1. Download the modified Teeworlds folder here
2. Give the start.sh 744 permissions using:
chmod 744 start.sh
3. Go into the Teeworlds directory, then srvfiles and edit the storage.cfg
Read the comments and edit the bottom two add_path

Optional for system boot (might only work on Debian and Ubuntu):
4. Create a symlink to your init.d directory using something similar like:
ln -s /home/user/teeworlds/start.sh /etc/init.d/teeworlds_srv
5. Update the rc.d levels using something like:
update-rc.d teeworlds_srv defaults 99 99


Setup the Teeworlds servers:
1. Put your configuration files into the configs directory
2. Put your serverfiles into the srvfiles directory
3. Put your maps into the data/maps directory
3. Edit the scripts.cfg file
Add a server using:
CONFIGFILE[SERVERNUMBER]=configurationfilename.cfg
SRVFILE[SERVERNUMBER]=serverfilename


How to use the scripts:
Start: sh start.sh start       # This starts all the Teeworlds servers
Stop: sh start.sh stop        # This stops all the Teeworlds servers
Restart: sh start.sh restart # This restarts all the Teeworlds servers
Status: sh start.sh status   # Get the Teeworlds server status
Start/Stop/Restart One server: sh start.sh manage {start|stop|restart} SERVERNUMBER

Update: sh install.sh update # Only updates the scripts and only works, if you installed using the install.sh


The Teeworlds servers will restart automatically when crashed or stopped.
The Teeworlds servers will start on system boot, if you set them up to do so.

Have fun managing your servers easier and more professionally!

Version: 1.3

2

Re: Linux - Teeworlds Server Scripts

I like linux so I like it if it's supported. But regarding your solution I'm afraid it's using too many non-standards like "unzip" (which is no default ), a wget for TW from an unknown URL (why not use default TW bins from teeworlds.com?) and a start-script which is not placed in /etc/init.d. Regarding your "read" line in the script I would change "read INPUT" to "read -sn1 INPUT" and throw the result through " | tr [:upper:] [:lower:]" or something like that ... and  I would strongly recommend to change from zip to tar.gz. For example if you get a Linux-VMS with preinstalled minimal setup the chance that unzip is not installed by default is very high - but the chance that no tar is installed is almost 0.

nohup would do the job... but on debian or *buntu I would prefer start-stop-daemon instead (which can create a pid file for you and even is able to start the stuff as different user).

Greetings,
Mo(2)

3 (edited by GBKing 2012-03-11 23:32:24)

Re: Linux - Teeworlds Server Scripts

Thank you very much for your response Mo(2).
I have now updated the scripts to now use the *.tar.gz format and to use the read -sn1 INPUT and also the tr [:upper:] [:lower:].
The teeworlds folder is downloaded from another URL, because it had to be modified a bit, to make the scripts easy to use.
The script does not run from init.d, because this would simply be unpractical in this case.
I am staying with nohup, because I think that it is a quite easy and practical solution.

4

Re: Linux - Teeworlds Server Scripts

files aint there sad

5

Re: Linux - Teeworlds Server Scripts

Yes, I know, I'm working on a system that works with python that will be available soon...

6 (edited by Hamid Jigool 2016-03-07 13:01:20)

Re: Linux - Teeworlds Server Scripts

links are broken
please upload it again
:-(