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