Browse Source

Merge pull request #13417 from RussellSenior/atftp-add-init-script

atftp: add init script and config file for atftpd
lilik-openwrt-22.03
Rosen Penev 4 years ago
committed by GitHub
parent
commit
efe525033d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 1 deletions
  1. +6
    -1
      net/atftp/Makefile
  2. +3
    -0
      net/atftp/files/atftpd.conf
  3. +17
    -0
      net/atftp/files/atftpd.init
  4. +3
    -0
      net/atftp/test.sh

+ 6
- 1
net/atftp/Makefile View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
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)
@ -53,6 +53,11 @@ endef
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


+ 3
- 0
net/atftp/files/atftpd.conf View File

@ -0,0 +1,3 @@
config service 'service'
option path '/srv/tftp'

+ 17
- 0
net/atftp/files/atftpd.init View File

@ -0,0 +1,17 @@
#!/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)
}

+ 3
- 0
net/atftp/test.sh View File

@ -0,0 +1,3 @@
#!/bin/sh
"$1" --version 2>&1 | grep "$2"

Loading…
Cancel
Save