File: xpilot-server.init

package info (click to toggle)
xpilot 4.5.5beta.20031222-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,696 kB
  • ctags: 8,771
  • sloc: ansic: 85,922; cpp: 4,282; tcl: 3,479; sh: 1,731; makefile: 334; perl: 134
file content (60 lines) | stat: -rw-r--r-- 1,515 bytes parent folder | download | duplicates (2)
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
53
54
55
56
57
58
59
60
#!/bin/bash
#
# xpilot-server	: start or stop the xpilot server
#
#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#		Modified for Debian GNU/Linux
#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#		Modified for Debian GNU/Linux xpilot-server package
#		by Matt Kern <matt.kern@pobox.com>
#		and by Ben Armstrong <synrg@sanctuary.nslug.ns.ca>

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

test -x /usr/games/start-xpilots || exit 0

USER=xpilots

set -e

source /etc/xpilots.conf

case "$1" in
  start)
	echo "$AUTOSTART" |grep -iq yes || exit 0
	test -f "$DEFAULTMAP" || exit 0

	echo -n "Starting xpilot server: "
	start-stop-daemon --start --quiet --user $USER --name xpilots \
		--oknodo --exec /usr/games/start-xpilots
	echo "xpilots."
	;;
  stop)
	echo -n "Stopping xpilot server: "
	if start-stop-daemon --stop --quiet --user $USER --name xpilots \
		--oknodo --retry 30 >/dev/null 2>&1; then
	   echo "xpilots."
        else
           echo "system-wide xpilots not running."
	fi
	;;
  restart|force-reload)
	echo -n "Restarting xpilot server: "
	start-stop-daemon --stop --quiet --user $USER --name xpilots \
		--oknodo --retry 30 >/dev/null 2>&1 || true

	echo "$AUTOSTART" |grep -iq yes || exit 0
	test -f "$DEFAULTMAP" || exit 0

	start-stop-daemon --start --quiet --user $USER --name xpilots \
		--oknodo --exec /usr/games/start-xpilots
	echo "xpilots."
	;;
  *)
	N=/etc/init.d/xpilot-server
	echo "Usage: $N {start|stop|restart|force-reload}" >&2
	exit 1
	;;
esac

exit 0