Signed-off-by: Russell Senior <russell@personaltelco.net>
PKG_NAME:=atftp
PKG_VERSION:=0.7.2
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
define Package/atftpd/install
$(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/atftpd.init $(1)/etc/init.d/atftpd
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_BIN) ./files/atftpd.conf $(1)/etc/config/atftpd
+ $(INSTALL_DIR) $(1)/srv/tftp
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)//usr/sbin/atftpd $(1)/usr/sbin/
endef
--- /dev/null
+
+config service 'service'
+ option path '/srv/tftp'
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2020 OpenWrt.org
+
+START=95
+PIDFILE=/tmp/run/atftpd.pid
+
+start() {
+ config_load atftpd
+ config_get SRV service path "/srv/tftp"
+ config_get PORT service port 69
+
+ atftpd --pidfile $PIDFILE --user root.root --port $PORT --daemon $SRV
+}
+
+stop() {
+ kill $(cat $PIDFILE)
+}