updated on Sun Jan 15 08:01:04 UTC 2012
[aur-mirror.git] / hgd / hgd-playd
blob5a2e0f695a448a8d78142cfc279de9679ee94d76
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON=hgd-playd
8 PID=$(get_pid $DAEMON)
10 case "$1" in
11 start)
12 if [ ! -r "/var/hgd/hgd.db" ]; then
13 printhl "You must run 'hgd-admin db-init' before starting playd"
14 stat_fail
15 exit 1
18 stat_busy "Starting $DAEMON"
20 [ -z "$PID" ] && `which $DAEMON` &>/dev/null
21 if [ $? = 0 ]; then
22 add_daemon $DAEMON
23 stat_done
24 else
25 stat_fail
26 exit 1
29 stop)
30 stat_busy "Stopping $DAEMON"
31 [ -n "$PID" ] && kill $PID &>/dev/null
32 if [ $? = 0 ]; then
33 rm_daemon $DAEMON
34 stat_done
35 else
36 stat_fail
37 exit 1
40 restart)
41 $0 stop
42 sleep 1
43 $0 start
46 echo "usage: $0 {start|stop|restart}"
47 esac
49 # vim:set ts=2 sw=2 et: