]> git.pld-linux.org Git - packages/crossfire.git/blame - crossfire.init
- do not use crossloop to start server (crossloop patch not needed anymore)
[packages/crossfire.git] / crossfire.init
CommitLineData
9f1d2768
JK
1#!/bin/sh
2#
3# chkconfig: 345 98 03
4# description: Starts and stops the Crossfire server
5#
6
7export PATH=/bin:/sbin:/usr/bin:/usr/sbin
8
9# Source function library.
10. /etc/rc.d/init.d/functions
11
12# Source networking configuration.
13. /etc/sysconfig/network
14
15# Demon specified configuration.
16. /etc/sysconfig/crossfire
17
18# Check that networking is up.
19if is_no "${NETWORKING}"; then
20 msg_Network_Down crossfire
21 exit 1
22fi
23
24TMPDIR="/tmp"; export TMPDIR
25cd /
26
27case "$1" in
28 start)
29 if [ ! -f /var/lock/subsys/crossfire ]; then
30 msg_starting crossfire
31 daemon "su games -s /bin/sh -c '/usr/X11R6/bin/crossloop >/dev/null 2>&1 &'"
32 RETVAL=$?
33 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crossfire
34 else
35 msg_Already_Running crossfire
36 exit 1
37 fi
38 ;;
39 stop)
40 if [ -f /var/lock/subsys/crossfire ]; then
41 msg_stopping crossloop
42 killproc crossloop
43 msg_stopping crossfire
44 killproc crossfire
45 rm -f /var/lock/subsys/crossfire >/dev/null 2>&1
46 else
47 msg_Not_Running crossfire
48 exit 1
49 fi
50 ;;
51 status)
52 status crossfire
53 status crossloop
54 exit $?
55 ;;
56 restart)
57 $0 stop
58 $0 start
59 ;;
60 reload)
61 if [ -f /var/lock/subsys/crossfire ]; then
62 msg_reloading crossfire
63 killproc crossfire
64 else
65 msg_Not_Running crossfire
66 exit 1
67 fi
68 ;;
69 *)
70 msg_Usage "$0 {start|stop|restart|reload|status}"
71 exit 1
72esac
This page took 0.08229 seconds and 4 git commands to generate.