Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | #! /bin/sh |
| 2 | # |
| 3 | # This is an init script for openembedded |
| 4 | # Copy it to /etc/init.d/atftpd and type |
| 5 | # > update-rc.d atftpd defaults 60 |
| 6 | # |
| 7 | |
| 8 | |
| 9 | test -f /usr/sbin/atftpd || exit 0 |
| 10 | |
| 11 | test -d /srv/tftp || mkdir -p /srv/tftp |
| 12 | |
| 13 | case "$1" in |
| 14 | start) |
| 15 | echo -n "Starting tftp daemon: atftpd" |
| 16 | start-stop-daemon --start --quiet --exec /usr/sbin/atftpd -- --daemon --port 69 |
| 17 | echo "." |
| 18 | ;; |
| 19 | stop) |
| 20 | echo -n "Stopping tftp daemon: atftpd" |
| 21 | start-stop-daemon --stop --quiet --exec /usr/sbin/atftpd |
| 22 | echo "." |
| 23 | ;; |
| 24 | reload|force-reload) |
| 25 | start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/atftpd |
| 26 | ;; |
| 27 | restart) |
| 28 | $0 stop |
| 29 | sleep 1 |
| 30 | $0 start |
| 31 | ;; |
| 32 | *) |
| 33 | echo "Usage: /etc/init.d/atftpd {start|stop|reload|restart|force-reload}" |
| 34 | exit 1 |
| 35 | esac |
| 36 | |
| 37 | exit 0 |