/[packages]/cauldron/yamagi-quake2/current/SOURCES/q2ctf.sh
ViewVC logotype

Contents of /cauldron/yamagi-quake2/current/SOURCES/q2ctf.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 175259 - (show annotations) (download) (as text)
Fri Dec 2 20:57:50 2011 UTC (12 years, 4 months ago) by shadow95
File MIME type: application/x-sh
File size: 1414 byte(s)
SILENT:
1 #!/bin/bash
2 #
3 # q2ctf
4 #
5 chkconfig: 2345 04 98
6 # description: Quake II "Capture The Flag" Server
7 # processname: q2ded
8 #
9 # taken from a connectiva RPM <aurelio@conectiva.com.br>.
10 # Modified for Mandrake by: Maxim Heijndijk <cchq@wanadoo.nl>
11 #
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 NAME=q2ded
16 SERVER_NAME=`hostname -s`
17 PID=/var/run/${NAME}.pid
18 Q2_CONFIGDIR="/etc/quake2"
19
20 # Look for server.cfg
21 if [ -f "${Q2_CONFIGDIR}/ctf/server.cfg" ]; then
22
23 if grep "^map[ ]" ${Q2_CONFIGDIR}/ctf/server.cfg; then
24
25 SERVER_CFG="+exec server.cfg"
26
27 else
28
29 gprintf "No map found in \"${Q2_CONFIGDIR}/ctf/server.cfg\". Put a line \"map <quake2map>\" in \"server.cfg\". Aborting..."
30 echo
31 exit 0
32
33 fi
34
35 fi
36
37 case "$1" in
38
39 start) gprintf "Starting Quake II \"Capture The Flag\" Server: "
40 daemon /usr/games/${NAME} +set game ctf \
41 +set hostname ${SERVER_NAME} \
42 ${SERVER_CFG} &
43 RETVAL=$?
44 echo
45 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${NAME}
46 ;;
47
48 stop) gprintf "Stopping Quake II \"Capture The Flag\" Server: "
49 killproc ${NAME}
50 killproc ${NAME}.bin
51 RETVAL=$?
52 echo
53 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${NAME}
54 ;;
55
56 status) gprintf "Status Quake II \"Capture The Flag\" Server: "
57 status ${NAME}
58 RETVAL=$?
59 ;;
60
61 restart) $0 stop
62 $0 start
63 RETVAL=$?
64 ;;
65
66 *) gprintf "Usage: %s {start|stop|status|restart}"
67 exit 1
68 ;;
69
70 esac
71
72 exit 0

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30