Merge pull request #22440 from myszsoda/atftpd_option_enable
atftpd: Add 'enable' config option
This commit is contained in:
commit
28f62b101e
3 changed files with 15 additions and 5 deletions
|
@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=atftp
|
PKG_NAME:=atftp
|
||||||
PKG_VERSION:=0.8.0
|
PKG_VERSION:=0.8.0
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
|
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
|
||||||
config service 'service'
|
config service 'service'
|
||||||
|
option enable '0'
|
||||||
option path '/srv/tftp'
|
option path '/srv/tftp'
|
||||||
|
option port '69'
|
||||||
|
|
|
@ -5,11 +5,19 @@ START=95
|
||||||
PIDFILE=/tmp/run/atftpd.pid
|
PIDFILE=/tmp/run/atftpd.pid
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
config_load atftpd
|
local enable
|
||||||
config_get SRV service path "/srv/tftp"
|
local srv
|
||||||
config_get PORT service port 69
|
local port
|
||||||
|
|
||||||
atftpd --pidfile $PIDFILE --user root.root --port $PORT --daemon $SRV
|
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
|
||||||
|
|
||||||
|
atftpd --pidfile $PIDFILE --user root.root --port $port --daemon $srv
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
|
|
Loading…
Reference in a new issue