--- /dev/null
+#!/bin/sh
+
+DAEMON="atftpd"
+PIDFILE="/var/run/$DAEMON.pid"
+ATFTPD_ARGS="--user root.root /tftpboot"
+
+# shellcheck disable=SC1090
+[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
+
+start() {
+ printf 'Starting %s: ' "$DAEMON"
+ # shellcheck disable=SC2086 # we need the word splitting
+ start-stop-daemon -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" -- \
+ --daemon --pidfile="$PIDFILE" $ATFTPD_ARGS
+ status=$?
+ if [ "$status" -eq 0 ]; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ return "$status"
+}
+
+stop() {
+ printf 'Stopping %s: ' "$DAEMON"
+ start-stop-daemon -K -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON"
+ status=$?
+ if [ "$status" -eq 0 ]; then
+ echo "OK"
+ else
+ echo "FAIL"
+ fi
+ return "$status"
+}
+
+case "$1" in
+start)
+ start
+ ;;
+stop)
+ stop
+ ;;
+restart|reload)
+ stop
+ start
+ ;;
+*)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
ATFTP_CONF_OPTS += --disable-libpcre
endif
+define ATFTP_INSTALL_INIT_SYSV
+ $(INSTALL) -m 755 -D package/atftp/S80atftpd \
+ $(TARGET_DIR)/etc/init.d/S80atftpd
+endef
+
$(eval $(autotools-package))