atftpd: update init script to publish tftp service

update init script to announce tftp service over mdns

Signed-off-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
This commit is contained in:
Mohd Husaam Mehdi 2024-03-29 22:49:37 +05:30 committed by Florian Eckert
parent 6afd740a89
commit 4695e2c10f
2 changed files with 4 additions and 1 deletions

View 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)

View File

@ -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
}