4 # description: Starts and stops the Crossfire server
7 export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin
9 # Source function library.
10 . /etc/rc.d/init.d/functions
12 # Source networking configuration.
13 . /etc/sysconfig/network
15 # Demon specified configuration.
16 . /etc/sysconfig/crossfire
18 # Check that networking is up.
19 if is_no "${NETWORKING}"; then
20 msg_network_down crossfire
24 TMPDIR="/tmp"; export TMPDIR
28 if [ ! -f /var/lock/subsys/crossfire ]; then
30 FLAGS="-log /var/log/crossfire"
31 if [ -n "$PORT" ] ; then
32 FLAGS="$FLAGS -csport $PORT"
34 if is_yes "$DEBUG" ; then
39 msg_starting crossfire
40 daemon su games -c "\"exec crossfire -detach $FLAGS >>/var/log/crossfire 2>&1\""
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crossfire
44 msg_already_running crossfire
49 if [ -f /var/lock/subsys/crossfire ]; then
50 msg_stopping crossfire
52 rm -f /var/lock/subsys/crossfire >/dev/null 2>&1
54 msg_Not_Running crossfire
60 su games -c "crossfire +d -s"
68 if [ -f /var/lock/subsys/crossfire ]; then
69 msg_reloading crossfire
72 msg_not_running crossfire
77 msg_Usage "$0 {start|stop|restart|reload|status}"