]> git.pld-linux.org Git - packages/crossfire.git/blame - crossfire.init
- perl interpreter path fix
[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
5e31074d 7export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
9f1d2768
JK
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
9f1d2768
JK
25
26case "$1" in
27 start)
28 if [ ! -f /var/lock/subsys/crossfire ]; then
5e31074d
JK
29 cd /
30 FLAGS="-log /var/log/crossfire"
31 if [ -n "$PORT" ] ; then
32 FLAGS="$FLAGS -csport $PORT"
33 fi
34 if is_yes "$DEBUG" ; then
35 FLAGS="$FLAGS -d"
36 else
37 FLAGS="$FLAGS +d"
38 fi
9f1d2768 39 msg_starting crossfire
5e31074d 40 daemon su games -c "\"exec crossfire -detach $FLAGS >>/var/log/crossfire 2>&1\""
9f1d2768
JK
41 RETVAL=$?
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crossfire
43 else
44 msg_Already_Running crossfire
45 exit 1
46 fi
47 ;;
48 stop)
49 if [ -f /var/lock/subsys/crossfire ]; then
9f1d2768
JK
50 msg_stopping crossfire
51 killproc crossfire
52 rm -f /var/lock/subsys/crossfire >/dev/null 2>&1
53 else
54 msg_Not_Running crossfire
55 exit 1
56 fi
57 ;;
58 status)
59 status crossfire
5e31074d 60 su games -c "crossfire +d -s"
9f1d2768
JK
61 exit $?
62 ;;
63 restart)
64 $0 stop
65 $0 start
66 ;;
67 reload)
68 if [ -f /var/lock/subsys/crossfire ]; then
69 msg_reloading crossfire
70 killproc crossfire
71 else
72 msg_Not_Running crossfire
73 exit 1
74 fi
75 ;;
76 *)
77 msg_Usage "$0 {start|stop|restart|reload|status}"
78 exit 1
79esac
This page took 0.107936 seconds and 4 git commands to generate.