Topic: Debian init.d script
Hello there - this is for everyone using debian:
----------------------------------------------------
#!/bin/sh
DIR="/usr/local/games/teeworlds"
CONF="conf.cfg"
case "$1" in
start)
echo "Starting Teeworlds Server..."
start-stop-daemon --start --chdir $DIR --background \
--chuid games:games --exec $DIR/teeworlds_srv -- -f $DIR/$CONF
PID=`ps ax | grep 'teeworlds_srv' | awk '{print $1}'| sed 2d`
echo $PID > /var/run/teeworlds.pid
echo "Started"
;;
stop)
echo "Stopping Teeworlds Server..."
start-stop-daemon --stop --pidfile /var/run/teeworlds.pid
echo "Stopped"
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: /etc/init.d/teeworlds {start|stop}"
exit 1
esac
exit 0
----------------------------------------------------
Use /etc/init.d/teeworlds to start/stop/restart your server
Greetings,
Daeli