1

Topic: teeman - a bash tool to manage your Teeworlds server(s)

Hellu everyone,

here is teeman, a simple script to manage your Teeworlds servers easily. Made in bash it works on linux.

What can you do with this?
You can start / stop your servers easily, get some informations such as the runtime, number of players in game, etc ...

Some examples :

Get some help

test@xxx:~$ teeman help
Usage: teeman [command] [arguments]

Manage Teeworlds servers

  teeman start <configuration>         - start the server <configuration>
  teeman stop <configuration>          - stop the server <configuration>
  teeman restart <configuration>       - restart the server <configuration>
  teeman status <configuration>        - get the status of the server <configuration>
  teeman fullstatus <configuration>    - get the fullstatus of the server <configuration>
  teeman list                          - list all the configurations

If no specific configuration file is given the command applies to all configuration files.
Configuration directory: /home/test/teeman/configuration

Start a server with the configuration my_ctf.conf

test@xxx:~$ teeman start my_ctf
my_ctf started (pid 26787)

Start all the configurations

test@xxx:~$ teeman start
my_ctf started (pid 20775)
ddr.my_srv started (pid 20797)

Stop a specific configuration

test@xxx:~$ teeman stop my_ctf
my_ctf stopped (pid 20775)

Get the status of all servers

test@xxx:~$ teeman status
my_ctf is running (pid 20775)
ddr.my_srv is running (pid 20797)

Get the fullstatus of a specific server

test@xxx:~$ teeman fullstatus my_ctf
name:              my_ctf
configuration:     /home/test/teeman/configuration/my_ctf.conf
log:               /home/test/teeman/log/my_ctf.log (568K)
state:             running (pid 20775)
handler:           teeworlds_srv
port:              8304
masterserver:      master2.teeworlds.com
gametype:          CTF
runtime:           242847s
first start:       2013-11-27 21:44:35
last start:        2013-11-28 23:25:25
current players:   0
all time players:  132

Display the list of configurations

test@xxx:~$ teeman list
my_ctf
ddr.my_srv

First you need to download the script on my repository
Follow the INSTALLATION section, it's quite fast, don't worry.
Once you have followed the procedure, just write down your configuration files in this folder ~/teeman/configurations
You must put the suffix .conf to each file, so they will be proceed by teeman.
Let's say you created the configuration test.conf, so you can start it this way :

test@xxx:~$ teeman start test

It also can work with MODs, for this it uses a system called hanlders. It's just a text file which defines rules. These rules tell which binary to call with which name.
For example with this in your handlers file:

# rule name ; prefix ; binary file
my ddrace rule;ddr;DDRace

All the configuration files starting with ddr. will be started by the DDRace binary. It's quite handy when you call teeman start alone, it runs all your configurations with the good binary.

I suggest your read the HANDLERS section of the README to get started with it.

Thanks for reading me.
Do not hesitate to give me feedback, critics, ideas of improvements etc ...
P.S: I tried it, but few bugs could come up, so I still consider it as BETA for now.

Need a tool to manage your servers? teeman
<3

2

Re: teeman - a bash tool to manage your Teeworlds server(s)

Looks nice. Thanks for sharing!

Not Luck, Just Magic.

3 (edited by KChris 2017-08-13 00:09:29)

Re: teeman - a bash tool to manage your Teeworlds server(s)

-deleted-

Lazy dev

4 (edited by floyd 2013-12-07 21:11:11)

Re: teeman - a bash tool to manage your Teeworlds server(s)

@Dune: thanks, I hope it helps.

@KChris: you are right, the $HOME variable seems more appropriate, thanks for trying it and giving me feedback this feedback smile

Though in case the user has no home (which is possible), this will still fail. I'll think of adding some check.

Need a tool to manage your servers? teeman
<3

5 (edited by KChris 2017-08-13 00:09:24)

Re: teeman - a bash tool to manage your Teeworlds server(s)

-deleted-

Lazy dev

6

Re: teeman - a bash tool to manage your Teeworlds server(s)

Thanks for your feedback and interest KChris.

Though your solution would not work all the time. As you said, it is possible that /home/${USER} does not exist, thus this won't be possible to create it (permissions not writable for others in /home).

About using it as root, I was against and I didn't lock it when I wrote it first. Now it's done.

About the _DIR problem, I fixed it by getting the code return of the mkdir command. It will say if it has created the folders, if not then it gives a notification. I kept the $HOME which is wiser, because if the user has has no home, then I consider he/she/it has no place to set teeman. smile

Need a tool to manage your servers? teeman
<3