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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 178533 - (show annotations) (download) (as text)
Wed Dec 7 19:25:50 2011 UTC (9 years, 9 months ago) by shadow95
File MIME type: application/x-sh
File size: 1357 byte(s)
- Fix script q2ctf.sh & q2ded.sh
- Fix some warning mixed tab on some line in spec
1 #!/bin/bash
2 #
3 # q2ded
4 #
5 chkconfig 2345 04 98
6 # description: Quake II Dedicated 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}/baseq2/server.cfg" ]; then
22
23 if grep "^map[ ]" ${Q2_CONFIGDIR}/baseq2/server.cfg; then
24
25 SERVER_CFG="+exec server.cfg"
26
27 else
28
29 echo -e "No map found in \"${Q2_CONFIGDIR}/baseq2/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 Dedicated Server: "
40 daemon /usr/games/${NAME} +set hostname ${SERVER_NAME} \
41 ${SERVER_CFG} &
42 RETVAL=$?
43 echo
44 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${NAME}
45 ;;
46
47 stop) gprintf "Stopping Quake II Dedicated Server: "
48 killproc ${NAME}
49 killproc ${NAME}.bin
50 RETVAL=$?
51 echo
52 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${NAME}
53 ;;
54
55 status) gprintf "Status Quake II Dedicated Server: "
56 status ${NAME}
57 RETVAL=$?
58 ;;
59
60 restart) $0 stop
61 $0 start
62 RETVAL=$?
63 ;;
64
65 *) gprintf "Usage: %s {start|stop|status|restart}"
66 exit 1
67 ;;
68
69 esac
70
71 exit 0

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.28