From 230c75ffd49e557a97d23f3cb184314ce027ca0f Mon Sep 17 00:00:00 2001 From: Ruakij Date: Tue, 7 Dec 2021 14:51:53 +0100 Subject: [PATCH] Fix match being wrong way around --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index c334d1b..4e35a9c 100644 --- a/src/main.js +++ b/src/main.js @@ -84,7 +84,7 @@ if(errorMsg){ const loggerTcpdump = logFactory("tcpdump"); let linkTypeId; proc.stderr.setEncoding("utf8").on("data", (data) => { - if(!data.match(/^(tcpdump: )?listening on /i) || !data.match(/^\d+ packets captured/i)) { // Catch start-error + if(data.match(/^(tcpdump: )?listening on /i) || data.match(/^\d+ packets captured/i)) { // Catch start-error loggerTcpdump.debug(data); if(!linkTypeId && data.match(/^(tcpdump: )?listening on/i)){ // Grab first data containing listen-info if proper header was found