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