systeminformation 5.12.14 → 5.12.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/network.js +6 -6
  2. package/package.json +1 -1
package/lib/network.js CHANGED
@@ -328,7 +328,6 @@ function getWindowsIfaceDNSsuffix(ifaces, ifacename) {
328
328
  if (!dnsSuffix) { dnsSuffix = ''; }
329
329
  return dnsSuffix;
330
330
  } catch (error) {
331
- // console.log('Error getting Connection-specific DNS suffix: ', error.message);
332
331
  return 'Unknown';
333
332
  }
334
333
  }
@@ -501,7 +500,6 @@ function parseLinesDarwinNics(sections) {
501
500
  function getDarwinNics() {
502
501
  const cmd = '/sbin/ifconfig -v';
503
502
  try {
504
- // console.log('SYNC - Nics darwin 12');
505
503
  const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n');
506
504
  const nsections = splitSectionsNics(lines);
507
505
  return (parseLinesDarwinNics(nsections));
@@ -620,7 +618,6 @@ function getDarwinIfaceDHCPstatus(iface) {
620
618
  let result = false;
621
619
  const cmd = `ipconfig getpacket "${iface}" 2>/dev/null | grep lease_time;`;
622
620
  try {
623
- // console.log('SYNC - DHCP status darwin 17');
624
621
  const lines = execSync(cmd).toString().split('\n');
625
622
  if (lines.length && lines[0].startsWith('lease_time')) {
626
623
  result = true;
@@ -1484,7 +1481,9 @@ function networkConnections(callback) {
1484
1481
  });
1485
1482
  }
1486
1483
  if (_darwin) {
1487
- let cmd = 'netstat -natv | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"';
1484
+ // let cmd = 'netstat -natv | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"';
1485
+ let cmd = 'netstat -natv | grep "tcp4\\|tcp6\\|udp4\\|udp6"';
1486
+ const states = 'ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN';
1488
1487
  exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {
1489
1488
  if (!error) {
1490
1489
 
@@ -1509,8 +1508,9 @@ function networkConnections(callback) {
1509
1508
  peeraddress.pop();
1510
1509
  peerip = peeraddress.join('.');
1511
1510
  }
1512
- let connstate = line[5];
1513
- let pid = parseInt(line[8], 10);
1511
+ const hasState = states.indexOf(line[5]) >= 0;
1512
+ let connstate = hasState ? line[5] : 'UNKNOWN';
1513
+ let pid = parseInt(line[8 + (hasState ? 0 : -1)], 10);
1514
1514
  if (connstate) {
1515
1515
  result.push({
1516
1516
  protocol: line[0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.12.14",
3
+ "version": "5.12.15",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",