updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / ddrace-git / ddraced
blobd0a5cf3189e0b6b5381e6a496d63c79a4624e810
1 #!/bin/bash
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 case "$1" in
9 start)
10 stat_busy "Starting DDRace Server"
11 cd /etc/
12 /usr/bin/ddrace_srv -f /etc/ddrace.conf >/dev/null &2>&1
13 sleep 5
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 pidof ddrace_srv > /var/run/ddraced.pid
18 add_daemon ddraced
19 stat_done
22 debug)
23 stat_busy "Starting DDRace Server DEBUG"
24 cd /etc/
25 /usr/bin/ddrace_srv -f /etc/ddrace.conf
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 add_daemon ddraced
30 stat_done
34 stop)
35 stat_busy "Stopping DDRace Server"
36 [ -f /var/run/ddraced.pid ] && kill $(cat /var/run/ddraced.pid) &> /dev/null
37 if [ $? -gt 0 ]; then
38 stat_fail
39 else
40 rm -f /var/run/ddraced.pid
41 rm_daemon ddraced
42 stat_done
45 restart)
46 $0 stop
47 sleep 1
48 $0 start
51 echo "usage: $0 {start|stop|restart|debug}"
52 esac
53 exit 0