move jdownloader
[ub0rlay.git] / games-arcade / teeworlds / files / teeworlds_init
bloba796cf82b4f92bbdb3b5f13944bb6a6b0915161f
1 #!/sbin/runscript
2 # Copyright 1999-2006 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
5 PIDFILE=/var/run/teeworlds.pid
6 GAME_DIRECTORY=/usr/games/bin
7 CONFIG=/etc/teeworlds/teeworlds_srv.cfg
9 depend() {
10         use dns logger net
13 checkconfig() {
14         if [ ! -e ${CONFIG} ] ; then
15                 eerror "You need an ${CONFIG} config file to run TeeWorlds"
16                 return 1
17         fi
20 start() {
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 $?
27 reload() {
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 $?
33 stop() {
34         ebegin "Stopping TeeWorlds"
35         start-stop-daemon --stop --quiet --pidfile "${PIDFILE}"
36         eend $?