systeminformation 5.31.6 → 5.31.7

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 +3 -2
  2. package/package.json +1 -1
package/lib/network.js CHANGED
@@ -17,6 +17,7 @@ const os = require('os');
17
17
  const exec = require('child_process').exec;
18
18
  const execSync = require('child_process').execSync;
19
19
  const execFileSync = require('child_process').execFileSync;
20
+ const readFileSync = require('fs').readFileSync;
20
21
 
21
22
  const fs = require('fs');
22
23
  const util = require('./util');
@@ -548,8 +549,8 @@ function getLinuxIfaceConnectionName(interfaceName) {
548
549
  function checkLinuxDCHPInterfaces(file) {
549
550
  let result = [];
550
551
  try {
551
- const cmd = `cat ${file} 2> /dev/null | grep 'iface\\|source'`;
552
- const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
552
+ const content = readFileSync(file, { encoding: 'utf8' });
553
+ const lines = content.split('\n').filter((l) => /iface|source/.test(l));
553
554
 
554
555
  lines.forEach((line) => {
555
556
  const parts = line.replace(/\s+/g, ' ').trim().split(' ');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.31.6",
3
+ "version": "5.31.7",
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)",