1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#! /bin/sh
#
# This file was automatically customized by debmake on Sun, 11 Oct 1998 18:12:42 -0700
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Debian by Christoph Lameter <clameter@debian.org>
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/games/crossfire
# The following value is extracted by debstd to figure out how to generate
# the postinst script. Edit the field to change the way the script is
# registered through update-rc.d (see the manpage for update-rc.d!)
FLAGS="defaults 50"
test -f $DAEMON || exit 0
umask 002
case "$1" in
restart|force-reload)
start-stop-daemon --stop --verbose --exec $DAEMON
echo -n "waiting a bit for the server to stop"
count=0
while test "`ps aux|grep /usr/games/crossfire|wc -l`" -gt 1
do
count=`expr $count + 1`
if [ $count -gt 30 ]
then
echo -n "crossfire not ready, not waiting any longer..."
break
fi
echo -n "."
sleep 1
done
echo
start-stop-daemon --start --chuid nobody:games --verbose --exec $DAEMON -- -detach
;;
start)
start-stop-daemon --start --chuid nobody:games --verbose --exec $DAEMON -- -detach
;;
stop)
start-stop-daemon --stop --verbose --exec $DAEMON
;;
*)
echo "Usage: /etc/init.d/crossfire {start|stop|restart}"
exit 1
;;
esac
exit 0
|