atftpd: update init script to publish tftp service
authorMohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
Fri, 29 Mar 2024 17:19:37 +0000 (22:49 +0530)
committerFlorian Eckert <Eckert.Florian@googlemail.com>
Thu, 28 Nov 2024 08:59:13 +0000 (09:59 +0100)
update init script to announce tftp service over mdns

Signed-off-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
net/atftp/Makefile
net/atftp/files/atftpd.init

index c7cf408812b8aed86c3e716315c41a0a44fec799..0e57c8815d2fa38213040d0e74801386f546cff6 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=atftp
 PKG_VERSION:=0.8.0
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
index b05beee4dfc3af6642bdc8e6a6b79bfe4002ab54..369c6bc778d47fbf18c5f17f657b3e884d1a7010 100755 (executable)
@@ -10,6 +10,7 @@ start_service() {
        local enable
        local srv
        local port
+       local mdns
 
        config_load atftpd
 
@@ -18,9 +19,11 @@ start_service() {
 
        config_get srv service path "/srv/tftp"
        config_get port service port 69
+       config_get mdns service mdns 0
 
        procd_open_instance
        procd_set_param command $BIN "--no-fork" "--daemon" "--user" "root.root" "--port" "$port" "$srv"
+       [ "${mdns}" -ne 0 ] && procd_add_mdns "tftp" "udp" "$port" "daemon=atftpd"
        procd_set_param respawn
        procd_close_instance
 }