Catch start-error from tcpdump

tcpdump writes to stderr at the beginning
This commit is contained in:
Ruakij 2021-11-29 13:18:29 +01:00
parent 45a11753de
commit c27761322c

View File

@ -71,7 +71,8 @@ if(errorMsg){
logger.debug("Attaching error-logger..");
const loggerTcpdump = logFactory("tcpdump");
proc.stderr.setEncoding("utf8").on("data", (data) => {
loggerTcpdump.error(data);
if(!data.match(/^(tcpdump: )?listening on /i)) // Catch start-error
loggerTcpdump.error(data);
});
logger.debug("Attaching exit-handler..");