updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / atftp-init / rc.d
blob13e57bfc9ea6a8f3b54d422fcfb32c35608b4a9d
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 ATFTPD_ARGS=
7 [ -f /etc/conf.d/atftpd ] && . /etc/conf.d/atftpd
9 PID=$(pidof -o %PPID /usr/sbin/atftpd)
10 case "$1" in
11 start)
12 stat_busy "Starting Advanced TFTPD"
13 [ -z "$PID" ] && /usr/sbin/atftpd ${ATFTPD_ARGS}
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 add_daemon tftpd
18 stat_done
21 stop)
22 stat_busy "Stopping Advanced TFTPD"
23 [ ! -z "$PID" ] && kill $PID &> /dev/null
24 if [ $? -gt 0 ]; then
25 stat_fail
26 else
27 rm_daemon tftpd
28 stat_done
31 restart)
32 $0 stop
33 $0 start
36 echo "usage: $0 {start|stop|restart}"
37 esac
38 exit 0