move jdownloader
[ub0rlay.git] / games-arcade / teeworlds / files / teeworlds_init
Commit [+]AuthorDateLineData
c732301f
FB
Felix Bechstein2009-03-25 16:44:45 +01001#!/sbin/runscript
2# Copyright 1999-2006 Gentoo Foundation
3# Distributed under the terms of the GNU General Public License v2
4
5PIDFILE=/var/run/teeworlds.pid
6GAME_DIRECTORY=/usr/games/bin
7CONFIG=/etc/teeworlds/teeworlds_srv.cfg
8
9depend() {
10 use dns logger net
11}
12
13checkconfig() {
14 if [ ! -e ${CONFIG} ] ; then
15 eerror "You need an ${CONFIG} config file to run TeeWorlds"
16 return 1
17 fi
18}
19
20start() {
21 ebegin "Starting TeeWorlds"
22 start-stop-daemon --start --background --pidfile "${PIDFILE}" --make-pidfile -d ${GAME_DIRECTORY} --chuid teeworlds --exec ${GAME_DIRECTORY}/teeworlds_srv \
23 -- -f ${CONFIG}
24 eend $?
25}
26
27reload() {
28 ebegin "Reloading TeeWorlds configs and restarting processes"
29 start-stop-daemon --stop --oknodo --chuid teeworlds --pidfile "${PIDFILE}" --signal HUP --exec ${GAME_DIRECTORY}/teeworlds_srv -- -f ${CONFIG}
30 eend $?
31}
32
33stop() {
34 ebegin "Stopping TeeWorlds"
35 start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
36 eend $?
37}