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_yes "${NETWORKING}"; then
20 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
21 msg_network_down crossfire
28 TMPDIR="/tmp"; export TMPDIR
33 if [ ! -f /var/lock/subsys/crossfire ]; then
35 FLAGS="-log /var/log/crossfire"
36 if [ -n "$PORT" ]; then
37 FLAGS="$FLAGS -csport $PORT"
39 if is_yes "$DEBUG" ; then
44 msg_starting crossfire
45 daemon su games -c "\"exec crossfire -detach $FLAGS >>/var/log/crossfire 2>&1\""
47 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/crossfire
49 msg_already_running crossfire
53 if [ -f /var/lock/subsys/crossfire ]; then
54 msg_stopping crossfire
56 rm -f /var/lock/subsys/crossfire >/dev/null 2>&1
58 msg_not_running crossfire
64 su games -c "crossfire +d -s"
72 if [ -f /var/lock/subsys/crossfire ]; then
73 msg_reloading crossfire
77 msg_not_running crossfire >&2
82 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"