diff --git a/lib/network.js b/lib/network.js index 5fa04cd..31f63dc 100644 --- a/lib/network.js +++ b/lib/network.js @@ -773,7 +773,6 @@ function networkInterfaces(callback, rescan) { let mtu = ''; let speed = null; let carrierChanges = 0; - let operstate = 'down'; let dhcp = false; let dnsSuffix = ''; let ieee8021xAuth = ''; @@ -852,7 +851,7 @@ function networkInterfaces(callback, rescan) { speed = isNaN(myspeed) ? null : myspeed; } carrierChanges = parseInt(util.getValue(lines, 'carrier_changes'), 10); - operstate = util.getValue(lines, 'operstate'); + const operstate = util.getValue(lines, 'operstate'); type = operstate === 'up' ? (util.getValue(lines, 'wireless').trim() ? 'wireless' : 'wired') : 'unknown'; if (iface === 'lo' || iface.startsWith('bond')) { type = 'virtual'; }