updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / netatalk-git / cnid
blob9aef04931249189ab8bcfa84b67adb6e65ba9790
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=$(pidof -o %PPID /usr/sbin/cnid_metad)
7 case "$1" in
8 start)
9 stat_busy "Starting cnid Daemon"
10 [ -z $PID ] && /usr/sbin/cnid_metad
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 PID=$(pidof -o %PPID /usr/sbin/cnid_metad)
15 echo "$PID" > /var/run/cnid.pid
16 add_daemon cnid
17 stat_done
20 stop)
21 stat_busy "Stopping cnid Daemon"
22 [ ! -z $PID ] && kill "$PID" &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon cnid
27 rm /var/run/cnid.pid
28 stat_done
31 restart)
32 $0 stop
33 sleep 1
34 $0 start
37 echo "usage: $0 {start|stop|restart}"
38 esac
39 exit 0