updated on Sat Jan 21 16:18:39 UTC 2012
[aur-mirror.git] / func / funcd
blob05e321c051c5d495b506bc39c7b2ef5ac57bfa93
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=$(pidof -x $(type -p funcd))
7 case "$1" in
8 start)
9 stat_busy "Starting Func Daemon"
10 if [ -z "$PID" ]; then
11 /usr/bin/funcd --daemon &
13 if [ ! -z "$PID" -o $? -gt 0 ]; then
14 stat_fail
15 else
16 PID=$(pidof -x $(type -p funcd))
17 echo $PID > /var/run/funcd.pid
18 add_daemon funcd
19 stat_done
22 stop)
23 stat_busy "Stopping Func Daemon"
24 [ ! -z "$PID" ] && kill $PID &> /dev/null
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon funcd
29 stat_done
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 {start|stop|restart}"
39 esac