#!/bin/bash
[[ -r /etc/sysconfig/ng-pcap ]] && source /etc/sysconfig/ng-pcap
[[ -z "$NG_PCAP_LOG_DIR" ]] && NG_PCAP_LOG_DIR="/var/log"

# READ: We are using snidump because tshark/dumpcap had high memory usage
# An interface is requred and at this stage we assume/hardcode eth0
# stdbuf is used to disable buffering
stdbuf -o0 snidump -i eth0 >> "${NG_PCAP_LOG_DIR}/$(basename $(readlink -f $0)).log"
