updated on Tue Jan 10 12:02:00 UTC 2012
[aur-mirror.git] / core / cored
blob970a71614a45a9ef7630d6968afbad9222216a74
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID="$(cat /var/run/coredpy.pid 2>/dev/null)"
7 case "$1" in
8 start)
9 stat_busy "Starting Core Service"
10 ([ -z "$PID" ] || [ -z "$(ps -ef | grep "$PID" | grep cored)" ]) && /usr/sbin/cored.py -d
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 PID=`cat /var/run/coredpy.pid`
15 add_daemon cored
16 stat_done
19 stop)
20 stat_busy "Stopping Core Service"
21 [ ! -z "$PID" ] && kill $PID &>/dev/null
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 rm_daemon cored
26 rm /var/run/coredpy.pid
27 stat_done
30 restart)
31 $0 stop
32 $0 start
35 echo "usage: $0 {start|stop|restart}"
36 esac
37 exit 0