4
# Required-Start: $remote_fs $syslog
5
# Required-Stop: $remote_fs $syslog
6
# Default-Start: 2 3 4 5
8
# Short-Description: Init script for bzflag-server
9
# Description: Init script for bzflag-server
15
DESC="BZFlag game server"
16
PIDFILE="/var/run/bzflag/game.pid"
17
LOGFILE="/var/log/bzflag/game.log"
18
BINARY="/usr/games/bzfs"
20
test -x ${BINARY} || exit 0
22
. /lib/lsb/init-functions
24
# Default to a free-for-all server which does not advertise its
26
OPTIONS="-advertise NONE"
27
# and that doesn't automatically start
29
# Override these with settings from /etc/default/${NAME} if said file exists
30
if test -f /etc/default/${NAME} ; then
31
. /etc/default/${NAME}
36
if [ "${ACTION}" != "start-now" ]
38
case "$(echo "${RUN_AT_STARTUP}" | tr A-Z a-z)" in
39
true|1|enabled|on|yes|ok)
47
log_daemon_msg "Starting ${DESC}" ${NAME}
48
mkdir -p /var/run/bzflag
49
chown -R games:games /var/run/bzflag
50
if ! start-stop-daemon --start -q -b --oknodo --pidfile ${PIDFILE} \
51
-c games:games --exec ${BINARY} -- \
52
-pidfile ${PIDFILE} ${OPTIONS} 2>&1 >> ${LOGFILE}
60
log_daemon_msg "Stopping ${DESC}" ${NAME}
61
if start-stop-daemon --stop -q --pidfile ${PIDFILE} \
62
--retry 10 --exec ${BINARY} 2>&1 >> ${LOGFILE}
76
status_of_proc -p ${PIDFILE} ${BINARY} bzfs && exit 0 || exit $?
79
echo "Usage: /etc/init.d/${NAME} {start[-now]|stop[-now]|restart|force-reload|status}"