mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
atftpd: update init script to use procd
* update init script to use procd Signed-off-by: Mohd Husaam Mehdi <husaam.mehdi@iopsys.eu>
This commit is contained in:
committed by
Florian Eckert
parent
3d05b2c1a9
commit
6afd740a89
@@ -2,9 +2,11 @@
|
||||
# Copyright (C) 2020 OpenWrt.org
|
||||
|
||||
START=95
|
||||
PIDFILE=/tmp/run/atftpd.pid
|
||||
|
||||
start() {
|
||||
USE_PROCD=1
|
||||
BIN=atftpd
|
||||
|
||||
start_service() {
|
||||
local enable
|
||||
local srv
|
||||
local port
|
||||
@@ -17,9 +19,8 @@ start() {
|
||||
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)
|
||||
procd_open_instance
|
||||
procd_set_param command $BIN "--no-fork" "--daemon" "--user" "root.root" "--port" "$port" "$srv"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user