From db48e7940666916b2ff515999d97ab2057c2bc97 Mon Sep 17 00:00:00 2001 From: Jakub Raczynski Date: Thu, 26 Oct 2023 21:01:10 +0000 Subject: atftpd: Refactor init script - Add local variables for read configuration - Convert uppercase to lowercase for local variables Signed-off-by: Jakub Raczynski --- net/atftp/files/atftpd.init | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'net') diff --git a/net/atftp/files/atftpd.init b/net/atftp/files/atftpd.init index 83573f998..d39c24e64 100755 --- a/net/atftp/files/atftpd.init +++ b/net/atftp/files/atftpd.init @@ -5,11 +5,15 @@ START=95 PIDFILE=/tmp/run/atftpd.pid start() { + local srv + local port + 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 + config_get srv service path "/srv/tftp" + config_get port service port 69 + + atftpd --pidfile $PIDFILE --user root.root --port $port --daemon $srv } stop() { -- cgit From 240ea8803f7e6f5aa040db8c4d56c19d57a19364 Mon Sep 17 00:00:00 2001 From: Jakub Raczynski Date: Thu, 26 Oct 2023 21:02:10 +0000 Subject: atftpd: Add missing field to default configuration Although init script did consist of default value for missing 'port' field, add it to configuration file for consistency. Signed-off-by: Jakub Raczynski --- net/atftp/files/atftpd.conf | 1 + 1 file changed, 1 insertion(+) (limited to 'net') diff --git a/net/atftp/files/atftpd.conf b/net/atftp/files/atftpd.conf index 6bd66e94c..2160763bb 100644 --- a/net/atftp/files/atftpd.conf +++ b/net/atftp/files/atftpd.conf @@ -1,3 +1,4 @@ config service 'service' option path '/srv/tftp' + option port '69' -- cgit From eeea8f4c6f10d0f7cd3e8fea20a4d1c0a36ad902 Mon Sep 17 00:00:00 2001 From: Jakub Raczynski Date: Thu, 26 Oct 2023 21:06:21 +0000 Subject: atftpd: Add 'enable' config option Current version of atftpd daemon does automatically start when installed. This commit adds 'enable' option to config file to have control over atftpd daemon. Signed-off-by: Jakub Raczynski --- net/atftp/Makefile | 2 +- net/atftp/files/atftpd.conf | 1 + net/atftp/files/atftpd.init | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'net') diff --git a/net/atftp/Makefile b/net/atftp/Makefile index cabdd3efd..0d281502e 100644 --- a/net/atftp/Makefile +++ b/net/atftp/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=atftp PKG_VERSION:=0.8.0 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/$(PKG_NAME) diff --git a/net/atftp/files/atftpd.conf b/net/atftp/files/atftpd.conf index 2160763bb..cea135d2e 100644 --- a/net/atftp/files/atftpd.conf +++ b/net/atftp/files/atftpd.conf @@ -1,4 +1,5 @@ config service 'service' + option enable '0' option path '/srv/tftp' option port '69' diff --git a/net/atftp/files/atftpd.init b/net/atftp/files/atftpd.init index d39c24e64..03627eeb3 100755 --- a/net/atftp/files/atftpd.init +++ b/net/atftp/files/atftpd.init @@ -5,11 +5,15 @@ START=95 PIDFILE=/tmp/run/atftpd.pid start() { + local enable local srv local port config_load atftpd + config_get enable service enable 0 + [ "$enable" -eq "0" ] && return 0 + config_get srv service path "/srv/tftp" config_get port service port 69 -- cgit