From c27761322c3348172de863d1a8f9b5406e84596f Mon Sep 17 00:00:00 2001 From: Ruakij Date: Mon, 29 Nov 2021 13:18:29 +0100 Subject: [PATCH] Catch start-error from tcpdump tcpdump writes to stderr at the beginning --- src/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 2c5f785..e7a732e 100644 --- a/src/main.js +++ b/src/main.js @@ -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..");