Catch start-error from tcpdump

tcpdump writes to stderr at the beginning
f_gracefulShutdown
Ruakij 3 years ago
parent 45a11753de
commit c27761322c

@ -71,7 +71,8 @@ if(errorMsg){
logger.debug("Attaching error-logger.."); logger.debug("Attaching error-logger..");
const loggerTcpdump = logFactory("tcpdump"); const loggerTcpdump = logFactory("tcpdump");
proc.stderr.setEncoding("utf8").on("data", (data) => { 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.."); logger.debug("Attaching exit-handler..");

Loading…
Cancel
Save