File: init.d

package info (click to toggle)
crossfire 1.6.0.dfsg.1-4sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 17,048 kB
  • ctags: 5,716
  • sloc: ansic: 64,739; sh: 8,485; perl: 2,347; lex: 2,024; makefile: 1,038
file content (52 lines) | stat: -rw-r--r-- 1,401 bytes parent folder | download
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