mirror of
https://github.com/openwrt/packages.git
synced 2025-02-07 09:19:51 +00:00
6cf3da648b
Signed-off-by: W. Michael Petullo <mike@flyn.org>
31 lines
600 B
Bash
31 lines
600 B
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2009-2012 OpenWrt.org
|
|
|
|
START=60
|
|
USE_PROCD=1
|
|
pidfile=/var/run/nfcapd.pid
|
|
PROG=/usr/bin/nfcapd
|
|
|
|
validate_nfcapd_section() {
|
|
uci_validate_section nfcapd nfcapd "${1}" \
|
|
'enabled:bool' \
|
|
'port:string' \
|
|
'logdir:string'
|
|
}
|
|
|
|
start_service() {
|
|
validate_nfcapd_section nfcapd || {
|
|
echo "validation failed"
|
|
return 1
|
|
}
|
|
|
|
[ "$enabled" -gt 0 ] && {
|
|
procd_open_instance
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_set_param command "$PROG"
|
|
procd_append_param command -S 1 -P "$pidfile" -p "$port" -l "$logdir"
|
|
procd_close_instance
|
|
}
|
|
}
|