diff options
author | W. Michael Petullo <mike@flyn.org> | 2020-02-03 20:33:55 -0500 |
---|---|---|
committer | W. Michael Petullo <mike@flyn.org> | 2020-02-12 22:12:33 -0500 |
commit | 6cf3da648b6fa5b3b464c7fc4c24fbc44965aa34 (patch) | |
tree | 4fb95246c5b86c58e688fcbf6a71a4aec70cdfeb /net/nfdump/files | |
parent | 05e23f15d9d9b00587727d4e2bab2bb1990a2b96 (diff) |
nfdump: add new package
Signed-off-by: W. Michael Petullo <mike@flyn.org>
Diffstat (limited to 'net/nfdump/files')
-rw-r--r-- | net/nfdump/files/nfcapd.config | 4 | ||||
-rw-r--r-- | net/nfdump/files/nfcapd.init | 30 |
2 files changed, 34 insertions, 0 deletions
diff --git a/net/nfdump/files/nfcapd.config b/net/nfdump/files/nfcapd.config new file mode 100644 index 000000000..54293c8fd --- /dev/null +++ b/net/nfdump/files/nfcapd.config @@ -0,0 +1,4 @@ +config nfcapd nfcapd + option enabled 0 + option port 9995 + option logdir /var/log diff --git a/net/nfdump/files/nfcapd.init b/net/nfdump/files/nfcapd.init new file mode 100644 index 000000000..f603e5880 --- /dev/null +++ b/net/nfdump/files/nfcapd.init @@ -0,0 +1,30 @@ +#!/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 + } +} |