From 89a48ca6961edb805752df999022ef97067bcff3 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Sun, 12 Jan 2020 12:11:05 +0100 Subject: [PATCH] networkInterfaces() prevent error getting DHCP Nics --- lib/network.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/network.js b/lib/network.js index f0b0673..a92a0ef 100644 --- a/lib/network.js +++ b/lib/network.js @@ -498,7 +498,7 @@ function getLinuxDHCPNics() { util.noop(); } try { - cmd = 'cat /etc/network/interfaces | grep iface'; + cmd = 'cat /etc/network/interfaces 2> /dev/null| grep iface'; const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n'); lines.forEach(line => { const parts = line.replace(/\s+/g, ' ').trim().split(' ');