updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / riak-search / riaksearch.rc
blob8e9cf67c3cd7a0054af90a349683a148f756b547
1 #!/bin/bash
3 bin=/var/lib/riaksearch/bin/riaksearch
4 daemon_name=riaksearch
6 . /etc/rc.conf
7 . /etc/rc.d/functions
9 case "$1" in
10 start)
11 stat_busy "Starting $daemon_name daemon"
13 # RUN
14 $bin start
15 if [ $? -gt 0 ]; then
16 stat_fail
17 exit 1
18 else
19 add_daemon $daemon_name
20 stat_done
24 stop)
25 stat_busy "Stopping $daemon_name daemon"
26 # KILL
27 $bin stop
28 if [ $? -gt 0 ]; then
29 stat_fail
30 exit 1
31 else
32 rm_daemon $daemon_name
33 stat_done
37 restart)
38 stat_busy "Restarting $daemon_name"
39 $bin restart
40 if [ $? -gt 0 ]; then
41 stat_fail
42 exit 1
43 else
44 rm_daemon $daemon_name
45 stat_done
49 attach)
50 stat_busy "Attaching to riak console"
51 $bin attach
52 stat_done
55 console)
56 stat_busy "Starting riak console"
57 $bin console
58 stat_done
61 status)
62 stat_busy "Checking Status"
63 $bin ping
64 stat_done
68 echo "usage: $0 {start|stop|restart|attach|console|status}"
69 esac
71 exit 0