systeminformation
Advanced tools
Comparing version 5.23.1 to 5.23.2
@@ -62,3 +62,3 @@ 'use strict'; | ||
try { | ||
const parts = execSync(cmd).toString().split('\n\n'); | ||
const parts = execSync(cmd, util.execOptsLinux).toString().split('\n\n'); | ||
parts.forEach(element => { | ||
@@ -65,0 +65,0 @@ const lines = element.split('\n'); |
@@ -132,3 +132,3 @@ 'use strict'; | ||
try { | ||
const hdicon = execSync('hcitool con').toString().toLowerCase(); | ||
const hdicon = execSync('hcitool con', util.execOptsLinux).toString().toLowerCase(); | ||
for (let i = 0; i < result.length; i++) { | ||
@@ -135,0 +135,0 @@ if (result[i].macDevice && result[i].macDevice.length > 10 && hdicon.indexOf(result[i].macDevice.toLowerCase()) >= 0) { |
@@ -142,3 +142,3 @@ 'use strict'; | ||
cmd = 'export LC_ALL=C; df -lkPTx squashfs; unset LC_ALL'; | ||
execSync('cat /proc/mounts 2>/dev/null').toString().split('\n').filter(line => { | ||
execSync('cat /proc/mounts 2>/dev/null', util.execOptsLinux).toString().split('\n').filter(line => { | ||
return line.startsWith('/'); | ||
@@ -430,3 +430,3 @@ }).forEach((line) => { | ||
if (element.type.startsWith('raid')) { | ||
const lines = execSync(`mdadm --export --detail /dev/${element.name}`).toString().split('\n'); | ||
const lines = execSync(`mdadm --export --detail /dev/${element.name}`, util.execOptsLinux).toString().split('\n'); | ||
const mdData = decodeMdabmData(lines); | ||
@@ -1092,3 +1092,3 @@ | ||
try { | ||
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(); | ||
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', util.execOptsLinux).toString(); | ||
let lines = blkStdoutToObject(out2).split('\n'); | ||
@@ -1106,3 +1106,3 @@ const data = parseBlk(lines); | ||
try { | ||
mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null').toString().split('\n')[0]; | ||
mediumType = execSync('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null', util.execOptsLinux).toString().split('\n')[0]; | ||
} catch (e) { | ||
@@ -1109,0 +1109,0 @@ util.noop(); |
@@ -219,3 +219,3 @@ 'use strict'; | ||
try { | ||
pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "').toString().split('\n'); | ||
pciIDs = execSync('export LC_ALL=C; dmidecode -t 9 2>/dev/null; unset LC_ALL | grep "Bus Address: "', util.execOptsLinux).toString().split('\n'); | ||
for (let i = 0; i < pciIDs.length; i++) { | ||
@@ -425,2 +425,5 @@ pciIDs[i] = pciIDs[i].replace('Bus Address:', '').replace('0000:', '').trim(); | ||
const cmd = nvidiaSmiExe + ' ' + nvidiaSmiOpts + (_linux ? ' 2>/dev/null' : ''); | ||
if (_linux) { | ||
options.stdio = ['pipe', 'pipe', 'ignore']; | ||
} | ||
try { | ||
@@ -427,0 +430,0 @@ const res = execSync(cmd, options).toString(); |
@@ -402,3 +402,3 @@ 'use strict'; | ||
try { | ||
let stdout = execSync('cat /proc/cpuinfo 2>/dev/null'); | ||
let stdout = execSync('cat /proc/cpuinfo 2>/dev/null', util.execOptsLinux); | ||
let lines = stdout.toString().split('\n'); | ||
@@ -423,3 +423,3 @@ let model = util.getValue(lines, 'hardware', ':', true).toUpperCase(); | ||
stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null'); | ||
stdout = execSync('vcgencmd get_config sdram_freq 2>/dev/null', util.execOptsLinux); | ||
lines = stdout.toString().split('\n'); | ||
@@ -431,3 +431,3 @@ let freq = parseInt(util.getValue(lines, 'sdram_freq', '=', true), 10) || 0; | ||
stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null'); | ||
stdout = execSync('vcgencmd measure_volts sdram_p 2>/dev/null', util.execOptsLinux); | ||
lines = stdout.toString().split('\n'); | ||
@@ -434,0 +434,0 @@ let voltage = parseFloat(util.getValue(lines, 'volt', '=', true)) || 0; |
@@ -171,3 +171,3 @@ 'use strict'; | ||
try { | ||
const stdout = execSync('hostnamectl --json short 2>/dev/null'); | ||
const stdout = execSync('hostnamectl --json short 2>/dev/null', util.execOptsLinux); | ||
const json = JSON.parse(stdout.toString()); | ||
@@ -178,3 +178,3 @@ | ||
try { | ||
const stdout = execSync('hostname -f 2>/dev/null'); | ||
const stdout = execSync('hostname -f 2>/dev/null', util.execOptsLinux); | ||
fqdn = stdout.toString().split(os.EOL)[0]; | ||
@@ -181,0 +181,0 @@ } catch (e) { |
@@ -155,3 +155,3 @@ 'use strict'; | ||
try { | ||
const tmpsrv = execSync('systemctl --all --type=service --no-legend 2> /dev/null').toString().split('\n'); | ||
const tmpsrv = execSync('systemctl --all --type=service --no-legend 2> /dev/null', util.execOptsLinux).toString().split('\n'); | ||
srvs = []; | ||
@@ -168,3 +168,3 @@ for (const s of tmpsrv) { | ||
srvString = ''; | ||
const tmpsrv = execSync('service --status-all 2> /dev/null').toString().split('\n'); | ||
const tmpsrv = execSync('service --status-all 2> /dev/null', util.execOptsLinux).toString().split('\n'); | ||
for (const s of tmpsrv) { | ||
@@ -179,3 +179,3 @@ const parts = s.split(']'); | ||
try { | ||
const srvStr = execSync('ls /etc/init.d/ -m 2> /dev/null').toString().split('\n').join(''); | ||
const srvStr = execSync('ls /etc/init.d/ -m 2> /dev/null', util.execOptsLinux).toString().split('\n').join(''); | ||
srvString = ''; | ||
@@ -182,0 +182,0 @@ if (srvStr) { |
@@ -64,3 +64,3 @@ 'use strict'; | ||
try { | ||
lines = execSync(cmd).toString().split('\n'); | ||
lines = execSync(cmd, util.execOptsLinux).toString().split('\n'); | ||
result.manufacturer = result.manufacturer === '' ? util.getValue(lines, 'sys_vendor') : result.manufacturer; | ||
@@ -111,3 +111,3 @@ result.model = result.model === '' ? util.getValue(lines, 'product_name') : result.model; | ||
try { | ||
const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null').toString(); | ||
const disksById = execSync('ls -1 /dev/disk/by-id/ 2>/dev/null', util.execOptsLinux).toString(); | ||
if (disksById.indexOf('_QEMU_') >= 0) { | ||
@@ -134,3 +134,3 @@ result.virtual = true; | ||
try { | ||
const procInfo = execSync('dmidecode -t 4'); | ||
const procInfo = execSync('dmidecode -t 4', util.execOptsLinux); | ||
const procLines = procInfo.toString().split('\n'); | ||
@@ -377,3 +377,3 @@ const procManufacturer = util.getValue(procLines, 'manufacturer', ':', true); | ||
try { | ||
lines = execSync(cmd).toString().split('\n'); | ||
lines = execSync(cmd, util.execOptsLinux).toString().split('\n'); | ||
result.vendor = !result.vendor ? util.getValue(lines, 'bios_vendor') : result.vendor; | ||
@@ -492,3 +492,3 @@ result.version = !result.version ? util.getValue(lines, 'bios_version') : result.version; | ||
try { | ||
lines = execSync(cmd).toString().split('\n'); | ||
lines = execSync(cmd, util.execOptsLinux).toString().split('\n'); | ||
result.manufacturer = !result.manufacturer ? util.getValue(lines, 'board_vendor') : result.manufacturer; | ||
@@ -495,0 +495,0 @@ result.model = !result.model ? util.getValue(lines, 'board_name') : result.model; |
@@ -58,2 +58,8 @@ 'use strict'; | ||
const execOptsLinux = { | ||
maxBuffer: 1024 * 20000, | ||
encoding: 'UTF-8', | ||
stdio: ['pipe', 'pipe', 'ignore'] | ||
}; | ||
function toInt(value) { | ||
@@ -577,3 +583,3 @@ let result = parseInt(value, 10); | ||
try { | ||
const stdout = execSync('echo $LANG'); | ||
const stdout = execSync('echo $LANG', util.execOptsLinux); | ||
const lines = stdout.toString().split('\r\n'); | ||
@@ -612,3 +618,3 @@ const parts = lines[0].split('.'); | ||
try { | ||
const pathArray = execSync('which smartctl 2>/dev/null', execOptsWin).toString().split('\r\n'); | ||
const pathArray = execSync('which smartctl 2>/dev/null', execOptsLinux).toString().split('\r\n'); | ||
_smartMonToolsInstalled = pathArray.length > 0; | ||
@@ -1152,3 +1158,3 @@ } catch (e) { | ||
try { | ||
result = execSync('uname -v').toString(); | ||
result = execSync('uname -v', util.execOptsLinux).toString(); | ||
} catch (e) { | ||
@@ -1325,2 +1331,3 @@ result = ''; | ||
exports.execOptsWin = execOptsWin; | ||
exports.execOptsLinux = execOptsLinux; | ||
exports.getCodepage = getCodepage; | ||
@@ -1327,0 +1334,0 @@ exports.execWin = execWin; |
@@ -133,3 +133,3 @@ 'use strict'; | ||
try { | ||
const all = execSync(cmd).toString().split('\n').map(line => line.trim()).join('\n'); | ||
const all = execSync(cmd, util.execOptsLinux).toString().split('\n').map(line => line.trim()).join('\n'); | ||
const parts = all.split('\nInterface '); | ||
@@ -153,3 +153,3 @@ parts.shift(); | ||
try { | ||
const all = execSync('nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null').toString(); | ||
const all = execSync('nmcli -t -f general,wifi-properties,wired-properties,interface-flags,capabilities,nsp device show 2>/dev/null', util.execOptsLinux).toString(); | ||
const parts = all.split('\n\n'); | ||
@@ -183,3 +183,3 @@ let i = 1; | ||
try { | ||
const lines = execSync(cmd).toString().split('\n'); | ||
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n'); | ||
const ssid = util.getValue(lines, 'GENERAL.CONNECTION'); | ||
@@ -202,3 +202,3 @@ return { | ||
try { | ||
const lines = execSync(cmd).toString().split('\n'); | ||
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n'); | ||
const bssid = util.getValue(lines, '802-11-wireless.seen-bssids').toLowerCase(); | ||
@@ -224,3 +224,3 @@ return { | ||
try { | ||
const lines = execSync(cmd).toString().split('\n'); | ||
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n'); | ||
const freq = util.toInt(util.getValue(lines, 'freq', '=')); | ||
@@ -244,3 +244,3 @@ return { | ||
try { | ||
const stdout = execSync(cmd, { maxBuffer: 1024 * 20000 }); | ||
const stdout = execSync(cmd, util.execOptsLinux); | ||
const parts = stdout.toString().split('ACTIVE:'); | ||
@@ -279,3 +279,3 @@ parts.shift(); | ||
try { | ||
let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`).toString().split(' Cell '); | ||
let iwlistParts = execSync(`export LC_ALL=C; iwlist ${iface} scan 2>&1; unset LC_ALL`, util.execOptsLinux).toString().split(' Cell '); | ||
if (iwlistParts[0].indexOf('resource busy') >= 0) { return -1; } | ||
@@ -414,3 +414,3 @@ if (iwlistParts.length > 1) { | ||
try { | ||
const iwconfigParts = execSync('export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL').toString().split('\n\n'); | ||
const iwconfigParts = execSync('export LC_ALL=C; iwconfig 2>/dev/null; unset LC_ALL', util.execOptsLinux).toString().split('\n\n'); | ||
let iface = ''; | ||
@@ -417,0 +417,0 @@ iwconfigParts.forEach(element => { |
{ | ||
"name": "systeminformation", | ||
"version": "5.23.1", | ||
"version": "5.23.2", | ||
"description": "Advanced, lightweight system and OS information library", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
747050
15834