updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / sqlgrey / rc.sqlgrey
blobbb88e12c84d4c5c87c2bd27662b4a4408de7180c
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 case "$1" in
7 start)
8 stat_busy "Starting sqlgrey Daemon"
10 # We need to cd to sqlgrey user home dir since
11 # if we're using sqlite as the database, it will
12 # put all it's files in the CWD.
13 cd ~sqlgrey
14 /usr/sbin/sqlgrey -d
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon sqlgrey
19 stat_done
22 stop)
23 stat_busy "Stopping sqlgrey Daemon"
24 /usr/sbin/sqlgrey -k
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon sqlgrey
29 stat_done
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 (start|stop|restart)"
39 esac
40 exit 0