systeminformation 5.17.11 → 5.17.12
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/osinfo.js +19 -15
- package/package.json +1 -1
package/lib/osinfo.js
CHANGED
|
@@ -1047,25 +1047,29 @@ function shell(callback) {
|
|
|
1047
1047
|
exports.shell = shell;
|
|
1048
1048
|
|
|
1049
1049
|
function getUniqueMacAdresses() {
|
|
1050
|
-
const ifaces = os.networkInterfaces();
|
|
1051
1050
|
let macs = [];
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
if (
|
|
1058
|
-
|
|
1051
|
+
try {
|
|
1052
|
+
const ifaces = os.networkInterfaces();
|
|
1053
|
+
for (let dev in ifaces) {
|
|
1054
|
+
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
|
1055
|
+
ifaces[dev].forEach(function (details) {
|
|
1056
|
+
if (details && details.mac && details.mac !== '00:00:00:00:00:00') {
|
|
1057
|
+
const mac = details.mac.toLowerCase();
|
|
1058
|
+
if (macs.indexOf(mac) === -1) {
|
|
1059
|
+
macs.push(mac);
|
|
1060
|
+
}
|
|
1059
1061
|
}
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1062
1064
|
}
|
|
1065
|
+
macs = macs.sort(function (a, b) {
|
|
1066
|
+
if (a < b) { return -1; }
|
|
1067
|
+
if (a > b) { return 1; }
|
|
1068
|
+
return 0;
|
|
1069
|
+
});
|
|
1070
|
+
} catch (e) {
|
|
1071
|
+
macs.push('00:00:00:00:00:00');
|
|
1063
1072
|
}
|
|
1064
|
-
macs = macs.sort(function (a, b) {
|
|
1065
|
-
if (a < b) { return -1; }
|
|
1066
|
-
if (a > b) { return 1; }
|
|
1067
|
-
return 0;
|
|
1068
|
-
});
|
|
1069
1073
|
return macs;
|
|
1070
1074
|
}
|
|
1071
1075
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "systeminformation",
|
|
3
|
-
"version": "5.17.
|
|
3
|
+
"version": "5.17.12",
|
|
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)",
|