updated on Wed Jan 25 16:08:47 UTC 2012
[aur-mirror.git] / pkgdistcache / pkgdistcached
blob1b57d877083031a7efae694462c8dc415fc65e26
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pgrep -f '/usr/bin/python /usr/bin/pkgdistcache-daemon'`
7 case "$1" in
8 start)
9 stat_busy "Starting pkgdistcache daemon"
10 [ -z "$PID" ] && /usr/bin/pkgdistcache-daemon
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 add_daemon pkgdistcached
15 stat_done
18 stop)
19 stat_busy "Stopping pkgdistcache daemon"
20 if [ ! -z "$PID" ]; then
21 kill $PID &> /dev/null
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 rm_daemon pkgdistcached
26 stat_done
28 else
29 stat_fail
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 {start|stop|restart}"
39 esac
40 exit 0