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 if is_yes "$STAT_LOSS_ON_DEATH" ; then
40 FLAGS="$FLAGS -stat_loss_on_death"
42 FLAGS="$FLAGS +stat_loss_on_death"
44 if is_yes "$BALANCED_STAT_LOSS" ; then
45 FLAGS="$FLAGS -balanced_stat_loss"
47 FLAGS="$FLAGS +balanced_stat_loss"
49 if is_yes "$USE_PERMANENT_EXPERIENCE" ; then
50 FLAGS="$FLAGS -use_permanent_experience"
52 FLAGS="$FLAGS +use_permanent_experience"
55 msg_starting crossfire
56 daemon su games -c "\"exec crossfire -detach $FLAGS >>/var/log/crossfire 2>&1\""
58 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crossfire
60 msg_Already_Running crossfire
65 if [ -f /var/lock/subsys/crossfire ]; then
66 msg_stopping crossfire
68 rm -f /var/lock/subsys/crossfire >/dev/null 2>&1
70 msg_Not_Running crossfire
76 su games -c "crossfire +d -s"
84 if [ -f /var/lock/subsys/crossfire ]; then
85 msg_reloading crossfire
88 msg_Not_Running crossfire
93 msg_Usage "$0 {start|stop|restart|reload|status}"