systeminformation 5.21.14 → 5.21.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.
package/lib/audio.js CHANGED
@@ -59,7 +59,7 @@ function getLinuxAudioPci() {
59
59
  let cmd = 'lspci -v 2>/dev/null';
60
60
  let result = [];
61
61
  try {
62
- const parts = execSync(cmd, { encoding: 'utf8' }).toString().split('\n\n');
62
+ const parts = execSync(cmd).toString().split('\n\n');
63
63
  parts.forEach(element => {
64
64
  const lines = element.split('\n');
65
65
  if (lines && lines.length && lines[0].toLowerCase().indexOf('audio') >= 0) {
package/lib/bluetooth.js CHANGED
@@ -129,7 +129,7 @@ function bluetoothDevices(callback) {
129
129
  });
130
130
  // determine "connected" with hcitool con
131
131
  try {
132
- const hdicon = execSync('hcitool con', { encoding: 'utf8' }).toString().toLowerCase();
132
+ const hdicon = execSync('hcitool con').toString().toLowerCase();
133
133
  for (let i = 0; i < result.length; i++) {
134
134
  if (result[i].macDevice && result[i].macDevice.length > 10 && hdicon.indexOf(result[i].macDevice.toLowerCase()) >= 0) {
135
135
  result[i].connected = true;
package/lib/cpu.js CHANGED
@@ -702,7 +702,7 @@ function getCpu() {
702
702
  if (os.arch() === 'arm64') {
703
703
  result.socket = 'SOC';
704
704
  try {
705
- const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type', { encoding: 'utf8' }).toString().split('\n');
705
+ const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type').toString().split('\n');
706
706
  const efficiencyCores = clusters.filter(line => line.indexOf('"E"') >= 0).length;
707
707
  const performanceCores = clusters.filter(line => line.indexOf('"P"') >= 0).length;
708
708
  result.efficiencyCores = efficiencyCores;
@@ -1048,7 +1048,7 @@ function cpuTemperature(callback) {
1048
1048
  // CPU Chipset, Socket
1049
1049
  try {
1050
1050
  const cmd = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;';
1051
- const parts = execSync(cmd, { encoding: 'utf8' }).toString().split('-----\n');
1051
+ const parts = execSync(cmd).toString().split('-----\n');
1052
1052
  if (parts.length === 2) {
1053
1053
  const lines = parts[0].split('\n');
1054
1054
  const lines2 = parts[1].split('\n');
@@ -1604,7 +1604,7 @@ function getLoad() {
1604
1604
  // linux: try to get other cpu stats
1605
1605
  if (_linux) {
1606
1606
  try {
1607
- const lines = execSync('cat /proc/stat 2>/dev/null | grep cpu', { encoding: 'utf8' }).split('\n');
1607
+ const lines = execSync('cat /proc/stat 2>/dev/null | grep cpu').toString().split('\n');
1608
1608
  if (lines.length > 1) {
1609
1609
  lines.shift();
1610
1610
  if (lines.length === cpus.length) {
package/lib/filesystem.js CHANGED
@@ -139,7 +139,7 @@ function fsSize(drive, callback) {
139
139
  if (_linux) {
140
140
  try {
141
141
  cmd = 'export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL';
142
- execSync('cat /proc/mounts 2>/dev/null', { encoding: 'utf8' }).toString().split('\n').filter(line => {
142
+ execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => {
143
143
  return line.startsWith('/');
144
144
  }).forEach((line) => {
145
145
  osMounts[line.split(' ')[0]] = osMounts[line.split(' ')[0]] || false;
@@ -426,7 +426,7 @@ function raidMatchLinux(data) {
426
426
  try {
427
427
  data.forEach(element => {
428
428
  if (element.type.startsWith('raid')) {
429
- const lines = execSync(`mdadm --export --detail /dev/${element.name}`, { encoding: 'utf8' }).toString().split('\n');
429
+ const lines = execSync(`mdadm --export --detail /dev/${element.name}`).toString().split('\n');
430
430
  const mdData = decodeMdabmData(lines);
431
431
 
432
432
  element.label = mdData.label; // <- assign label info
@@ -1087,7 +1087,7 @@ function diskLayout(callback) {
1087
1087
  } catch (e) {
1088
1088
  // fallback to older version of lsblk
1089
1089
  try {
1090
- const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL', { encoding: 'utf8' }).toString();
1090
+ const out2 = execSync('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL').toString();
1091
1091
  let lines = blkStdoutToObject(out2).split('\n');
1092
1092
  const data = parseBlk(lines);
1093
1093
  devices = data.filter(item => { return (item.type === 'disk') && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mount === '' && item.label === '' && item.fsType === '')); });
@@ -1100,7 +1100,7 @@ function diskLayout(callback) {
1100
1100
  const BSDName = '/dev/' + device.name;
1101
1101
  const logical = device.name;
1102
1102
  try {
1103
- mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null', { encoding: 'utf8' }).toString().split('\n')[0];
1103
+ mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null').toString().split('\n')[0];
1104
1104
  } catch (e) {
1105
1105
  util.noop();
1106
1106
  }
@@ -1406,7 +1406,7 @@ function diskLayout(callback) {
1406
1406
  workload.push(util.powerShell('Get-PhysicalDisk | select BusType,MediaType,FriendlyName,Model,SerialNumber,Size | fl'));
1407
1407
  if (util.smartMonToolsInstalled()) {
1408
1408
  try {
1409
- const smartDev = JSON.parse(execSync('smartctl --scan -j'));
1409
+ const smartDev = JSON.parse(execSync('smartctl --scan -j').toString());
1410
1410
  if (smartDev && smartDev.devices && smartDev.devices.length > 0) {
1411
1411
  smartDev.devices.forEach((dev) => {
1412
1412
  workload.push(execPromiseSave(`smartctl -j -a ${dev.name}`, util.execOptsWin));
package/lib/graphics.js CHANGED
@@ -216,7 +216,7 @@ function graphics(callback) {
216
216
  // PCI bus IDs
217
217
  let pciIDs = [];
218
218
  try {
219
- pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "', { encoding: 'utf8' }).toString().split('\n');
219
+ pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "').toString().split('\n');
220
220
  for (let i = 0; i < pciIDs.length; i++) {
221
221
  pciIDs[i] = pciIDs[i].replace('Bus Address:', '').replace('0000:', '').trim();
222
222
  }
package/lib/memory.js CHANGED
@@ -399,7 +399,7 @@ function memLayout(callback) {
399
399
 
400
400
  // Try Raspberry PI
401
401
  try {
402
- let stdout = execSync('cat /proc/cpuinfo 2>/dev/null', { encoding: 'utf8' });
402
+ let stdout = execSync('cat /proc/cpuinfo 2>/dev/null');
403
403
  let lines = stdout.toString().split('\n');
404
404
  let model = util.getValue(lines, 'hardware', ':', true).toUpperCase();
405
405
  let version = util.getValue(lines, 'revision', ':', true).toLowerCase();
@@ -419,14 +419,14 @@ function memLayout(callback) {
419
419
  result[0].clockSpeed = version && version[4] && version[4] === 'd' ? 500 : result[0].clockSpeed;
420
420
  result[0].formFactor = 'SoC';
421
421
 
422
- stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null', { encoding: 'utf8' });
422
+ stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null');
423
423
  lines = stdout.toString().split('\n');
424
424
  let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0;
425
425
  if (freq) {
426
426
  result[0].clockSpeed = freq;
427
427
  }
428
428
 
429
- stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null', { encoding: 'utf8' });
429
+ stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null');
430
430
  lines = stdout.toString().split('\n');
431
431
  let voltage = parseFloat(util.getValue(lines, 'volt', '=', true)) || 0;
432
432
  if (voltage) {
package/lib/network.js CHANGED
@@ -91,7 +91,7 @@ function getDefaultNetworkInterface() {
91
91
  }
92
92
  if (_linux) {
93
93
  let cmd = 'ip route 2> /dev/null | grep default';
94
- let result = execSync(cmd, { encoding: 'utf8' });
94
+ let result = execSync(cmd);
95
95
  let parts = result.toString().split('\n')[0].split(/\s+/);
96
96
  if (parts[0] === 'none' && parts[5]) {
97
97
  ifacename = parts[5];
@@ -108,7 +108,7 @@ function getDefaultNetworkInterface() {
108
108
  if (_linux) { cmd = 'ip route 2> /dev/null | grep default | awk \'{print $5}\''; }
109
109
  if (_darwin) { cmd = 'route -n get default 2>/dev/null | grep interface: | awk \'{print $2}\''; }
110
110
  if (_freebsd || _openbsd || _netbsd || _sunos) { cmd = 'route get 0.0.0.0 | grep interface:'; }
111
- let result = execSync(cmd, { encoding: 'utf8' });
111
+ let result = execSync(cmd);
112
112
  ifacename = result.toString().split('\n')[0];
113
113
  if (ifacename.indexOf(':') > -1) {
114
114
  ifacename = ifacename.split(':')[1].trim();
@@ -130,7 +130,7 @@ function getMacAddresses() {
130
130
  if (_linux || _freebsd || _openbsd || _netbsd) {
131
131
  if (typeof pathToIp === 'undefined') {
132
132
  try {
133
- const lines = execSync('which ip', { encoding: 'utf8' }).toString().split('\n');
133
+ const lines = execSync('which ip').toString().split('\n');
134
134
  if (lines.length && lines[0].indexOf(':') === -1 && lines[0].indexOf('/') === 0) {
135
135
  pathToIp = lines[0];
136
136
  } else {
@@ -142,7 +142,7 @@ function getMacAddresses() {
142
142
  }
143
143
  try {
144
144
  const cmd = 'export LC_ALL=C; ' + ((pathToIp) ? pathToIp + ' link show up' : '/sbin/ifconfig') + '; unset LC_ALL';
145
- let res = execSync(cmd, { encoding: 'utf8' });
145
+ let res = execSync(cmd);
146
146
  const lines = res.toString().split('\n');
147
147
  for (let i = 0; i < lines.length; i++) {
148
148
  if (lines[i] && lines[i][0] !== ' ') {
@@ -172,7 +172,7 @@ function getMacAddresses() {
172
172
  if (_darwin) {
173
173
  try {
174
174
  const cmd = '/sbin/ifconfig';
175
- let res = execSync(cmd, { encoding: 'utf8' });
175
+ let res = execSync(cmd);
176
176
  const lines = res.toString().split('\n');
177
177
  for (let i = 0; i < lines.length; i++) {
178
178
  if (lines[i] && lines[i][0] !== '\t' && lines[i].indexOf(':') > 0) {
@@ -511,7 +511,7 @@ function getLinuxIfaceConnectionName(interfaceName) {
511
511
  const cmd = `nmcli device status 2>/dev/null | grep ${interfaceName}`;
512
512
 
513
513
  try {
514
- const result = execSync(cmd, { encoding: 'utf8' }).toString();
514
+ const result = execSync(cmd).toString();
515
515
  const resultFormat = result.replace(/\s+/g, ' ').trim();
516
516
  const connectionNameLines = resultFormat.split(' ').slice(3);
517
517
  const connectionName = connectionNameLines.join(' ');
@@ -525,7 +525,7 @@ function checkLinuxDCHPInterfaces(file) {
525
525
  let result = [];
526
526
  try {
527
527
  let cmd = `cat ${file} 2> /dev/null | grep 'iface\\|source'`;
528
- const lines = execSync(cmd, { maxBuffer: 1024 * 20000, encoding: 'utf8' }).toString().split('\n');
528
+ const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n');
529
529
 
530
530
  lines.forEach(line => {
531
531
  const parts = line.replace(/\s+/g, ' ').trim().split(' ');
@@ -550,7 +550,7 @@ function getLinuxDHCPNics() {
550
550
  let cmd = 'ip a 2> /dev/null';
551
551
  let result = [];
552
552
  try {
553
- const lines = execSync(cmd, { maxBuffer: 1024 * 20000, encoding: 'utf8' }).toString().split('\n');
553
+ const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n');
554
554
  const nsections = splitSectionsNics(lines);
555
555
  result = (parseLinuxDHCPNics(nsections));
556
556
  } catch (e) {
@@ -591,7 +591,7 @@ function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {
591
591
  if (connectionName) {
592
592
  const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep ipv4.method;`;
593
593
  try {
594
- const lines = execSync(cmd, { encoding: 'utf8' }).toString();
594
+ const lines = execSync(cmd).toString();
595
595
  const resultFormat = lines.replace(/\s+/g, ' ').trim();
596
596
 
597
597
  let dhcStatus = resultFormat.split(' ').slice(1).toString();
@@ -631,7 +631,7 @@ function getLinuxIfaceDNSsuffix(connectionName) {
631
631
  if (connectionName) {
632
632
  const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep ipv4.dns-search;`;
633
633
  try {
634
- const result = execSync(cmd, { encoding: 'utf8' }).toString();
634
+ const result = execSync(cmd).toString();
635
635
  const resultFormat = result.replace(/\s+/g, ' ').trim();
636
636
  const dnsSuffix = resultFormat.split(' ').slice(1).toString();
637
637
  return dnsSuffix == '--' ? 'Not defined' : dnsSuffix;
@@ -647,7 +647,7 @@ function getLinuxIfaceIEEE8021xAuth(connectionName) {
647
647
  if (connectionName) {
648
648
  const cmd = `nmcli connection show "${connectionName}" 2>/dev/null | grep 802-1x.eap;`;
649
649
  try {
650
- const result = execSync(cmd, { encoding: 'utf8' }).toString();
650
+ const result = execSync(cmd).toString();
651
651
  const resultFormat = result.replace(/\s+/g, ' ').trim();
652
652
  const authenticationProtocol = resultFormat.split(' ').slice(1).toString();
653
653
 
@@ -875,7 +875,7 @@ function networkInterfaces(callback, rescan, defaultString) {
875
875
 
876
876
  let lines = [];
877
877
  try {
878
- lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
878
+ lines = execSync(cmd).toString().split('\n');
879
879
  const connectionName = getLinuxIfaceConnectionName(ifaceSanitized);
880
880
  dhcp = getLinuxIfaceDHCPstatus(ifaceSanitized, connectionName, _dhcpNics);
881
881
  dnsSuffix = getLinuxIfaceDNSsuffix(connectionName);
package/lib/osinfo.js CHANGED
@@ -168,13 +168,13 @@ function getFQDN() {
168
168
  let fqdn = os.hostname;
169
169
  if (_linux || _darwin) {
170
170
  try {
171
- const stdout = execSync('hostnamectl --json short 2>/dev/null', { encoding: 'utf8' });
171
+ const stdout = execSync('hostnamectl --json short 2>/dev/null');
172
172
  const json = JSON.parse(stdout.toString());
173
173
 
174
174
  fqdn = json['StaticHostname'];
175
175
  } catch (e) {
176
176
  try {
177
- const stdout = execSync('hostname -f 2>/dev/null', { encoding: 'utf8' });
177
+ const stdout = execSync('hostname -f 2>/dev/null');
178
178
  fqdn = stdout.toString().split(os.EOL)[0];
179
179
  } catch (e) {
180
180
  util.noop();
package/lib/processes.js CHANGED
@@ -152,7 +152,7 @@ function services(srv, callback) {
152
152
  if (_linux || _freebsd || _openbsd || _netbsd || _darwin) {
153
153
  if ((_linux || _freebsd || _openbsd || _netbsd) && srvString === '*') {
154
154
  try {
155
- const tmpsrv = execSync('systemctl --all --type=service --no-legend 2> /dev/null', { encoding: 'utf8' }).toString().split('\n');
155
+ const tmpsrv = execSync('systemctl --all --type=service --no-legend 2> /dev/null').toString().split('\n');
156
156
  srvs = [];
157
157
  for (const s of tmpsrv) {
158
158
  const name = s.split('.service')[0];
@@ -164,7 +164,7 @@ function services(srv, callback) {
164
164
  } catch (d) {
165
165
  try {
166
166
  srvString = '';
167
- const tmpsrv = execSync('service --status-all 2> /dev/null', { encoding: 'utf8' }).toString().split('\n');
167
+ const tmpsrv = execSync('service --status-all 2> /dev/null').toString().split('\n');
168
168
  for (const s of tmpsrv) {
169
169
  const parts = s.split(']');
170
170
  if (parts.length === 2) {
@@ -174,7 +174,7 @@ function services(srv, callback) {
174
174
  srvs = srvString.split('|');
175
175
  } catch (e) {
176
176
  try {
177
- const srvStr = execSync('ls /etc/init.d/ -m 2> /dev/null', { encoding: 'utf8' }).toString().split('\n').join('');
177
+ const srvStr = execSync('ls /etc/init.d/ -m 2> /dev/null').toString().split('\n').join('');
178
178
  srvString = '';
179
179
  if (srvStr) {
180
180
  const tmpsrv = srvStr.split(',');
package/lib/system.js CHANGED
@@ -61,7 +61,7 @@ function system(callback) {
61
61
  echo -n "product_version: "; cat /sys/devices/virtual/dmi/id/product_version 2>/dev/null; echo;
62
62
  echo -n "sys_vendor: "; cat /sys/devices/virtual/dmi/id/sys_vendor 2>/dev/null; echo;`;
63
63
  try {
64
- lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
64
+ lines = execSync(cmd).toString().split('\n');
65
65
  result.manufacturer = result.manufacturer === '' ? util.getValue(lines, 'sys_vendor') : result.manufacturer;
66
66
  result.model = result.model === '' ? util.getValue(lines, 'product_name') : result.model;
67
67
  result.version = result.version === '' ? util.getValue(lines, 'product_version') : result.version;
@@ -107,7 +107,7 @@ function system(callback) {
107
107
  }
108
108
  if (!result.virtual) {
109
109
  try {
110
- const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null', { encoding: 'utf8' }).toString();
110
+ const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null').toString();
111
111
  if (disksById.indexOf('_QEMU_') >= 0) {
112
112
  result.virtual = true;
113
113
  result.virtualHost = 'QEMU';
@@ -129,7 +129,7 @@ function system(callback) {
129
129
  }
130
130
  if ((_freebsd || _openbsd || _netbsd) && !result.virtualHost) {
131
131
  try {
132
- const procInfo = execSync('dmidecode -t 4', { encoding: 'utf8' });
132
+ const procInfo = execSync('dmidecode -t 4');
133
133
  const procLines = procInfo.toString().split('\n');
134
134
  const procManufacturer = util.getValue(procLines, 'manufacturer', ':', true);
135
135
  switch (procManufacturer.toLowerCase()) {
@@ -155,7 +155,7 @@ function system(callback) {
155
155
  result.model = 'Docker Container';
156
156
  }
157
157
  try {
158
- const stdout = execSync('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"', { encoding: 'utf8' });
158
+ const stdout = execSync('dmesg 2>/dev/null | grep -iE "virtual|hypervisor" | grep -iE "vmware|qemu|kvm|xen" | grep -viE "Nested Virtualization|/virtual/"');
159
159
  // detect virtual machines
160
160
  let lines = stdout.toString().split('\n');
161
161
  if (lines.length > 0) {
@@ -369,7 +369,7 @@ function bios(callback) {
369
369
  echo -n "bios_vendor: "; cat /sys/devices/virtual/dmi/id/bios_vendor 2>/dev/null; echo;
370
370
  echo -n "bios_version: "; cat /sys/devices/virtual/dmi/id/bios_version 2>/dev/null; echo;`;
371
371
  try {
372
- lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
372
+ lines = execSync(cmd).toString().split('\n');
373
373
  result.vendor = !result.vendor ? util.getValue(lines, 'bios_vendor') : result.vendor;
374
374
  result.version = !result.version ? util.getValue(lines, 'bios_version') : result.version;
375
375
  datetime = util.getValue(lines, 'bios_date');
@@ -483,7 +483,7 @@ function baseboard(callback) {
483
483
  echo -n "board_vendor: "; cat /sys/devices/virtual/dmi/id/board_vendor 2>/dev/null; echo;
484
484
  echo -n "board_version: "; cat /sys/devices/virtual/dmi/id/board_version 2>/dev/null; echo;`;
485
485
  try {
486
- lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
486
+ lines = execSync(cmd).toString().split('\n');
487
487
  result.manufacturer = !result.manufacturer ? util.getValue(lines, 'board_vendor') : result.manufacturer;
488
488
  result.model = !result.model ? util.getValue(lines, 'board_name') : result.model;
489
489
  result.version = !result.version ? util.getValue(lines, 'board_version') : result.version;
@@ -507,15 +507,17 @@ function baseboard(callback) {
507
507
  } catch (e) {
508
508
  util.noop();
509
509
  }
510
- const hardware = util.getValue(linesRpi, 'hardware');
511
- if (hardware.startsWith('BCM')) {
512
- const rpi = util.decodePiCpuinfo(linesRpi);
513
- result.manufacturer = rpi.manufacturer;
514
- result.model = 'Raspberry Pi';
515
- result.serial = rpi.serial;
516
- result.version = rpi.type + ' - ' + rpi.revision;
517
- result.memMax = os.totalmem();
518
- result.memSlots = 0;
510
+ if (linesRpi) {
511
+ const hardware = util.getValue(linesRpi, 'hardware');
512
+ if (hardware.startsWith('BCM')) {
513
+ const rpi = util.decodePiCpuinfo(linesRpi);
514
+ result.manufacturer = rpi.manufacturer;
515
+ result.model = 'Raspberry Pi';
516
+ result.serial = rpi.serial;
517
+ result.version = rpi.type + ' - ' + rpi.revision;
518
+ result.memMax = os.totalmem();
519
+ result.memSlots = 0;
520
+ }
519
521
  }
520
522
 
521
523
  if (callback) { callback(result); }
package/lib/util.js CHANGED
@@ -705,22 +705,23 @@ function sanitizeShellString(str, strict) {
705
705
  s[i] === '$' ||
706
706
  s[i] === ';' ||
707
707
  s[i] === '&' ||
708
- s[i] === '(' ||
709
- s[i] === ')' ||
710
708
  s[i] === ']' ||
711
709
  s[i] === '#' ||
712
710
  s[i] === '\\' ||
713
711
  s[i] === '\t' ||
714
712
  s[i] === '\n' ||
713
+ s[i] === '\r' ||
715
714
  s[i] === '\'' ||
716
715
  s[i] === '`' ||
717
716
  s[i] === '"' ||
718
717
  s[i].length > 1 ||
718
+ (strict && s[i] === '(') ||
719
+ (strict && s[i] === ')') ||
719
720
  (strict && s[i] === '@') ||
720
721
  (strict && s[i] === ' ') ||
721
722
  (strict && s[i] == '{') ||
722
723
  (strict && s[i] == ';') ||
723
- (strict && s[i] == ')'))) {
724
+ (strict && s[i] == '}'))) {
724
725
  result = result + s[i];
725
726
  }
726
727
  }
package/lib/wifi.js CHANGED
@@ -127,7 +127,7 @@ function ifaceListLinux() {
127
127
  const result = [];
128
128
  const cmd = 'iw dev 2>/dev/null';
129
129
  try {
130
- const all = execSync(cmd, { encoding: 'utf8' }).toString().split('\n').map(line => line.trim()).join('\n');
130
+ const all = execSync(cmd).toString().split('\n').map(line => line.trim()).join('\n');
131
131
  const parts = all.split('\nInterface ');
132
132
  parts.shift();
133
133
  parts.forEach(ifaceDetails => {
@@ -146,8 +146,8 @@ function ifaceListLinux() {
146
146
  return result;
147
147
  } catch (e) {
148
148
  try {
149
- const all = execSync('nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null', { encoding: 'utf8' }).toString();
150
- const parts = all.split('\nGENERAL.DEVICE:');
149
+ const all = execSync('nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null').toString();
150
+ const parts = all.split('\n\n');
151
151
  let i = 1;
152
152
  parts.forEach(ifaceDetails => {
153
153
  const lines = ifaceDetails.split('\n');
@@ -175,7 +175,7 @@ function ifaceListLinux() {
175
175
  function nmiDeviceLinux(iface) {
176
176
  const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2>/dev/null`;
177
177
  try {
178
- const lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
178
+ const lines = execSync(cmd).toString().split('\n');
179
179
  const ssid = util.getValue(lines, 'GENERAL.CONNECTION');
180
180
  return {
181
181
  iface,
@@ -193,7 +193,7 @@ function nmiDeviceLinux(iface) {
193
193
  function nmiConnectionLinux(ssid) {
194
194
  const cmd = `nmcli -t --show-secrets connection show ${ssid} 2>/dev/null`;
195
195
  try {
196
- const lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
196
+ const lines = execSync(cmd).toString().split('\n');
197
197
  const bssid = util.getValue(lines, '802-11-wireless.seen-bssids').toLowerCase();
198
198
  return {
199
199
  ssid: ssid !== '--' ? ssid : null,
@@ -209,9 +209,12 @@ function nmiConnectionLinux(ssid) {
209
209
  }
210
210
 
211
211
  function wpaConnectionLinux(iface) {
212
+ if (!iface) {
213
+ return {};
214
+ }
212
215
  const cmd = `wpa_cli -i ${iface} status 2>&1`;
213
216
  try {
214
- const lines = execSync(cmd, { encoding: 'utf8' }).toString().split('\n');
217
+ const lines = execSync(cmd).toString().split('\n');
215
218
  const freq = util.toInt(util.getValue(lines, 'freq', '='));
216
219
  return {
217
220
  ssid: util.getValue(lines, 'ssid', '='),
@@ -230,7 +233,7 @@ function getWifiNetworkListNmi() {
230
233
  const result = [];
231
234
  const cmd = 'nmcli -t -m multiline --fields active,ssid,bssid,mode,chan,freq,signal,security,wpa-flags,rsn-flags device wifi list 2>/dev/null';
232
235
  try {
233
- const stdout = execSync(cmd, { maxBuffer: 1024 * 20000, encoding: 'utf8' });
236
+ const stdout = execSync(cmd, { maxBuffer: 1024 * 20000 });
234
237
  const parts = stdout.toString().split('ACTIVE:');
235
238
  parts.shift();
236
239
  parts.forEach(part => {
@@ -263,7 +266,7 @@ function getWifiNetworkListNmi() {
263
266
  function getWifiNetworkListIw(iface) {
264
267
  const result = [];
265
268
  try {
266
- let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`, { encoding: 'utf8' }).toString().split(' Cell ');
269
+ let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`).toString().split(' Cell ');
267
270
  if (iwlistParts[0].indexOf('resource busy') >= 0) { return -1; }
268
271
  if (iwlistParts.length > 1) {
269
272
  iwlistParts.shift();
@@ -397,7 +400,7 @@ function wifiNetworks(callback) {
397
400
  result = getWifiNetworkListNmi();
398
401
  if (result.length === 0) {
399
402
  try {
400
- const iwconfigParts = execSync('export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL', { encoding: 'utf8' }).toString().split('\n\n');
403
+ const iwconfigParts = execSync('export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL').toString().split('\n\n');
401
404
  let iface = '';
402
405
  iwconfigParts.forEach(element => {
403
406
  if (element.indexOf('no wireless') === -1 && element.trim() !== '') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.21.14",
3
+ "version": "5.21.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)",