networkConnections() fix missing PIDs ss command (linux)
This commit is contained in:
parent
7797367bc3
commit
e717459a95
@ -90,6 +90,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
||||||
|
| 5.28.2 | 2025-12-27 | `networkConnections()` fix missing PIDs ss command (linux) |
|
||||||
| 5.28.1 | 2025-12-26 | `networkInterface()` fix secondary and link-local ip (linux, macOS) |
|
| 5.28.1 | 2025-12-26 | `networkInterface()` fix secondary and link-local ip (linux, macOS) |
|
||||||
| 5.28.0 | 2025-12-25 | `cpuTemperature()` added suppurt for macos-temperature-sensor (macOS) |
|
| 5.28.0 | 2025-12-25 | `cpuTemperature()` added suppurt for macos-temperature-sensor (macOS) |
|
||||||
| 5.27.17 | 2025-12-24 | `graphics()` fix nvidia-smi candidateDir (windows) |
|
| 5.27.17 | 2025-12-24 | `graphics()` fix nvidia-smi candidateDir (windows) |
|
||||||
|
|||||||
@ -57,6 +57,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">5.28.2</th>
|
||||||
|
<td>2025-12-27</td>
|
||||||
|
<td><span class="code">networkConnections()</span> fix missing PIDs ss command (linux)</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">5.28.1</th>
|
<th scope="row">5.28.1</th>
|
||||||
<td>2025-12-26</td>
|
<td>2025-12-26</td>
|
||||||
|
|||||||
@ -170,7 +170,7 @@
|
|||||||
<img class="logo" src="assets/logo.png" alt="logo">
|
<img class="logo" src="assets/logo.png" alt="logo">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span> </div>
|
<div class="subtitle"><span id="typed"></span> </div>
|
||||||
<div class="version">New Version: <span id="version">5.28.1</span></div>
|
<div class="version">New Version: <span id="version">5.28.2</span></div>
|
||||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
|
|||||||
@ -19,7 +19,7 @@ const execSync = require('child_process').execSync;
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const util = require('./util');
|
const util = require('./util');
|
||||||
|
|
||||||
let _platform = process.platform;
|
const _platform = process.platform;
|
||||||
|
|
||||||
const _linux = _platform === 'linux' || _platform === 'android';
|
const _linux = _platform === 'linux' || _platform === 'android';
|
||||||
const _darwin = _platform === 'darwin';
|
const _darwin = _platform === 'darwin';
|
||||||
@ -29,7 +29,7 @@ const _openbsd = _platform === 'openbsd';
|
|||||||
const _netbsd = _platform === 'netbsd';
|
const _netbsd = _platform === 'netbsd';
|
||||||
const _sunos = _platform === 'sunos';
|
const _sunos = _platform === 'sunos';
|
||||||
|
|
||||||
let _network = {};
|
const _network = {};
|
||||||
let _default_iface = '';
|
let _default_iface = '';
|
||||||
let _ifaces = {};
|
let _ifaces = {};
|
||||||
let _dhcpNics = [];
|
let _dhcpNics = [];
|
||||||
@ -41,14 +41,14 @@ function getDefaultNetworkInterface() {
|
|||||||
let ifacename = '';
|
let ifacename = '';
|
||||||
let ifacenameFirst = '';
|
let ifacenameFirst = '';
|
||||||
try {
|
try {
|
||||||
let ifaces = os.networkInterfaces();
|
const ifaces = os.networkInterfaces();
|
||||||
|
|
||||||
let scopeid = 9999;
|
let scopeid = 9999;
|
||||||
|
|
||||||
// fallback - "first" external interface (sorted by scopeid)
|
// fallback - "first" external interface (sorted by scopeid)
|
||||||
for (let dev in ifaces) {
|
for (let dev in ifaces) {
|
||||||
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
||||||
ifaces[dev].forEach(function (details) {
|
ifaces[dev].forEach((details) => {
|
||||||
if (details && details.internal === false) {
|
if (details && details.internal === false) {
|
||||||
ifacenameFirst = ifacenameFirst || dev; // fallback if no scopeid
|
ifacenameFirst = ifacenameFirst || dev; // fallback if no scopeid
|
||||||
if (details.scopeid && details.scopeid < scopeid) {
|
if (details.scopeid && details.scopeid < scopeid) {
|
||||||
@ -79,7 +79,7 @@ function getDefaultNetworkInterface() {
|
|||||||
if (defaultIp) {
|
if (defaultIp) {
|
||||||
for (let dev in ifaces) {
|
for (let dev in ifaces) {
|
||||||
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
||||||
ifaces[dev].forEach(function (details) {
|
ifaces[dev].forEach((details) => {
|
||||||
if (details && details.address && details.address === defaultIp) {
|
if (details && details.address && details.address === defaultIp) {
|
||||||
ifacename = dev;
|
ifacename = dev;
|
||||||
}
|
}
|
||||||
@ -89,9 +89,9 @@ function getDefaultNetworkInterface() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (_linux) {
|
if (_linux) {
|
||||||
let cmd = 'ip route 2> /dev/null | grep default';
|
const cmd = 'ip route 2> /dev/null | grep default';
|
||||||
let result = execSync(cmd, util.execOptsLinux);
|
const result = execSync(cmd, util.execOptsLinux);
|
||||||
let parts = result.toString().split('\n')[0].split(/\s+/);
|
const parts = result.toString().split('\n')[0].split(/\s+/);
|
||||||
if (parts[0] === 'none' && parts[5]) {
|
if (parts[0] === 'none' && parts[5]) {
|
||||||
ifacename = parts[5];
|
ifacename = parts[5];
|
||||||
} else if (parts[4]) {
|
} else if (parts[4]) {
|
||||||
@ -113,7 +113,7 @@ function getDefaultNetworkInterface() {
|
|||||||
if (_freebsd || _openbsd || _netbsd || _sunos) {
|
if (_freebsd || _openbsd || _netbsd || _sunos) {
|
||||||
cmd = 'route get 0.0.0.0 | grep interface:';
|
cmd = 'route get 0.0.0.0 | grep interface:';
|
||||||
}
|
}
|
||||||
let result = execSync(cmd);
|
const result = execSync(cmd);
|
||||||
ifacename = result.toString().split('\n')[0];
|
ifacename = result.toString().split('\n')[0];
|
||||||
if (ifacename.indexOf(':') > -1) {
|
if (ifacename.indexOf(':') > -1) {
|
||||||
ifacename = ifacename.split(':')[1].trim();
|
ifacename = ifacename.split(':')[1].trim();
|
||||||
@ -133,7 +133,7 @@ exports.getDefaultNetworkInterface = getDefaultNetworkInterface;
|
|||||||
function getMacAddresses() {
|
function getMacAddresses() {
|
||||||
let iface = '';
|
let iface = '';
|
||||||
let mac = '';
|
let mac = '';
|
||||||
let result = {};
|
const result = {};
|
||||||
if (_linux || _freebsd || _openbsd || _netbsd) {
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
||||||
if (typeof pathToIp === 'undefined') {
|
if (typeof pathToIp === 'undefined') {
|
||||||
try {
|
try {
|
||||||
@ -149,12 +149,12 @@ function getMacAddresses() {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const cmd = 'export LC_ALL=C; ' + (pathToIp ? pathToIp + ' link show up' : '/sbin/ifconfig') + '; unset LC_ALL';
|
const cmd = 'export LC_ALL=C; ' + (pathToIp ? pathToIp + ' link show up' : '/sbin/ifconfig') + '; unset LC_ALL';
|
||||||
let res = execSync(cmd, util.execOptsLinux);
|
const res = execSync(cmd, util.execOptsLinux);
|
||||||
const lines = res.toString().split('\n');
|
const lines = res.toString().split('\n');
|
||||||
for (let i = 0; i < lines.length; i++) {
|
for (let i = 0; i < lines.length; i++) {
|
||||||
if (lines[i] && lines[i][0] !== ' ') {
|
if (lines[i] && lines[i][0] !== ' ') {
|
||||||
if (pathToIp) {
|
if (pathToIp) {
|
||||||
let nextline = lines[i + 1].trim().split(' ');
|
const nextline = lines[i + 1].trim().split(' ');
|
||||||
if (nextline[0] === 'link/ether') {
|
if (nextline[0] === 'link/ether') {
|
||||||
iface = lines[i].split(' ')[1];
|
iface = lines[i].split(' ')[1];
|
||||||
iface = iface.slice(0, iface.length - 1);
|
iface = iface.slice(0, iface.length - 1);
|
||||||
@ -203,7 +203,7 @@ function getMacAddresses() {
|
|||||||
function networkInterfaceDefault(callback) {
|
function networkInterfaceDefault(callback) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let result = getDefaultNetworkInterface();
|
const result = getDefaultNetworkInterface();
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(result);
|
callback(result);
|
||||||
}
|
}
|
||||||
@ -218,7 +218,7 @@ exports.networkInterfaceDefault = networkInterfaceDefault;
|
|||||||
// NET - interfaces
|
// NET - interfaces
|
||||||
|
|
||||||
function parseLinesWindowsNics(sections, nconfigsections) {
|
function parseLinesWindowsNics(sections, nconfigsections) {
|
||||||
let nics = [];
|
const nics = [];
|
||||||
for (let i in sections) {
|
for (let i in sections) {
|
||||||
try {
|
try {
|
||||||
if ({}.hasOwnProperty.call(sections, i)) {
|
if ({}.hasOwnProperty.call(sections, i)) {
|
||||||
@ -230,10 +230,10 @@ function parseLinesWindowsNics(sections, nconfigsections) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
util.noop();
|
util.noop();
|
||||||
}
|
}
|
||||||
let netEnabled = util.getValue(lines, 'NetEnabled', ':');
|
const netEnabled = util.getValue(lines, 'NetEnabled', ':');
|
||||||
let adapterType = util.getValue(lines, 'AdapterTypeID', ':') === '9' ? 'wireless' : 'wired';
|
let adapterType = util.getValue(lines, 'AdapterTypeID', ':') === '9' ? 'wireless' : 'wired';
|
||||||
let ifacename = util.getValue(lines, 'Name', ':').replace(/\]/g, ')').replace(/\[/g, '(');
|
const ifacename = util.getValue(lines, 'Name', ':').replace(/\]/g, ')').replace(/\[/g, '(');
|
||||||
let iface = util.getValue(lines, 'NetConnectionID', ':').replace(/\]/g, ')').replace(/\[/g, '(');
|
const iface = util.getValue(lines, 'NetConnectionID', ':').replace(/\]/g, ')').replace(/\[/g, '(');
|
||||||
if (ifacename.toLowerCase().indexOf('wi-fi') >= 0 || ifacename.toLowerCase().indexOf('wireless') >= 0) {
|
if (ifacename.toLowerCase().indexOf('wi-fi') >= 0 || ifacename.toLowerCase().indexOf('wireless') >= 0) {
|
||||||
adapterType = 'wireless';
|
adapterType = 'wireless';
|
||||||
}
|
}
|
||||||
@ -448,7 +448,7 @@ function getWindowsIEEE8021x(connectionType, iface, ifaces) {
|
|||||||
function splitSectionsNics(lines) {
|
function splitSectionsNics(lines) {
|
||||||
const result = [];
|
const result = [];
|
||||||
let section = [];
|
let section = [];
|
||||||
lines.forEach(function (line) {
|
lines.forEach((line) => {
|
||||||
if (!line.startsWith('\t') && !line.startsWith(' ')) {
|
if (!line.startsWith('\t') && !line.startsWith(' ')) {
|
||||||
if (section.length) {
|
if (section.length) {
|
||||||
result.push(section);
|
result.push(section);
|
||||||
@ -480,7 +480,7 @@ function parseLinesDarwinNics(sections) {
|
|||||||
};
|
};
|
||||||
const first = section[0];
|
const first = section[0];
|
||||||
nic.iface = first.split(':')[0].trim();
|
nic.iface = first.split(':')[0].trim();
|
||||||
let parts = first.split('> mtu');
|
const parts = first.split('> mtu');
|
||||||
nic.mtu = parts.length > 1 ? parseInt(parts[1], 10) : null;
|
nic.mtu = parts.length > 1 ? parseInt(parts[1], 10) : null;
|
||||||
if (isNaN(nic.mtu)) {
|
if (isNaN(nic.mtu)) {
|
||||||
nic.mtu = null;
|
nic.mtu = null;
|
||||||
@ -562,7 +562,7 @@ function checkLinuxDCHPInterfaces(file) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (line.toLowerCase().includes('source')) {
|
if (line.toLowerCase().includes('source')) {
|
||||||
let file = line.split(' ')[1];
|
const file = line.split(' ')[1];
|
||||||
result = result.concat(checkLinuxDCHPInterfaces(file));
|
result = result.concat(checkLinuxDCHPInterfaces(file));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -574,7 +574,7 @@ function checkLinuxDCHPInterfaces(file) {
|
|||||||
|
|
||||||
function getLinuxDHCPNics() {
|
function getLinuxDHCPNics() {
|
||||||
// alternate methods getting interfaces using DHCP
|
// alternate methods getting interfaces using DHCP
|
||||||
let cmd = 'ip a 2> /dev/null';
|
const cmd = 'ip a 2> /dev/null';
|
||||||
let result = [];
|
let result = [];
|
||||||
try {
|
try {
|
||||||
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
|
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
|
||||||
@ -621,7 +621,7 @@ function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {
|
|||||||
const lines = execSync(cmd, util.execOptsLinux).toString();
|
const lines = execSync(cmd, util.execOptsLinux).toString();
|
||||||
const resultFormat = lines.replace(/\s+/g, ' ').trim();
|
const resultFormat = lines.replace(/\s+/g, ' ').trim();
|
||||||
|
|
||||||
let dhcStatus = resultFormat.split(' ').slice(1).toString();
|
const dhcStatus = resultFormat.split(' ').slice(1).toString();
|
||||||
switch (dhcStatus) {
|
switch (dhcStatus) {
|
||||||
case 'auto':
|
case 'auto':
|
||||||
result = true;
|
result = true;
|
||||||
@ -762,7 +762,7 @@ function networkInterfaces(callback, rescan, defaultString) {
|
|||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let ifaces = os.networkInterfaces();
|
const ifaces = os.networkInterfaces();
|
||||||
|
|
||||||
let result = [];
|
let result = [];
|
||||||
let nics = [];
|
let nics = [];
|
||||||
@ -1066,7 +1066,7 @@ function networkInterfaces(callback, rescan, defaultString) {
|
|||||||
_ifaces = JSON.parse(JSON.stringify(ifaces));
|
_ifaces = JSON.parse(JSON.stringify(ifaces));
|
||||||
const defaultInterface = getDefaultNetworkInterface();
|
const defaultInterface = getDefaultNetworkInterface();
|
||||||
|
|
||||||
getWindowsNics().then(function (nics) {
|
getWindowsNics().then((nics) => {
|
||||||
nics.forEach((nic) => {
|
nics.forEach((nic) => {
|
||||||
let found = false;
|
let found = false;
|
||||||
Object.keys(ifaces).forEach((key) => {
|
Object.keys(ifaces).forEach((key) => {
|
||||||
@ -1114,7 +1114,7 @@ function networkInterfaces(callback, rescan, defaultString) {
|
|||||||
|
|
||||||
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
if ({}.hasOwnProperty.call(ifaces, dev)) {
|
||||||
let ifaceName = dev;
|
let ifaceName = dev;
|
||||||
ifaces[dev].forEach(function (details) {
|
ifaces[dev].forEach((details) => {
|
||||||
if (details.family === 'IPv4' || details.family === 4) {
|
if (details.family === 'IPv4' || details.family === 4) {
|
||||||
ip4 = details.address;
|
ip4 = details.address;
|
||||||
ip4subnet = details.netmask;
|
ip4subnet = details.netmask;
|
||||||
@ -1219,7 +1219,7 @@ exports.networkInterfaces = networkInterfaces;
|
|||||||
// NET - Speed
|
// NET - Speed
|
||||||
|
|
||||||
function calcNetworkSpeed(iface, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors) {
|
function calcNetworkSpeed(iface, rx_bytes, tx_bytes, operstate, rx_dropped, rx_errors, tx_dropped, tx_errors) {
|
||||||
let result = {
|
const result = {
|
||||||
iface,
|
iface,
|
||||||
operstate,
|
operstate,
|
||||||
rx_bytes,
|
rx_bytes,
|
||||||
@ -1420,7 +1420,7 @@ function networkStatsSingle(iface) {
|
|||||||
'cat /sys/class/net/' +
|
'cat /sys/class/net/' +
|
||||||
ifaceSanitized +
|
ifaceSanitized +
|
||||||
'/statistics/tx_errors; ';
|
'/statistics/tx_errors; ';
|
||||||
exec(cmd, function (error, stdout) {
|
exec(cmd, (error, stdout) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
lines = stdout.toString().split('\n');
|
lines = stdout.toString().split('\n');
|
||||||
operstate = lines[0].trim();
|
operstate = lines[0].trim();
|
||||||
@ -1441,7 +1441,7 @@ function networkStatsSingle(iface) {
|
|||||||
}
|
}
|
||||||
if (_freebsd || _openbsd || _netbsd) {
|
if (_freebsd || _openbsd || _netbsd) {
|
||||||
cmd = 'netstat -ibndI ' + ifaceSanitized; // lgtm [js/shell-command-constructed-from-input]
|
cmd = 'netstat -ibndI ' + ifaceSanitized; // lgtm [js/shell-command-constructed-from-input]
|
||||||
exec(cmd, function (error, stdout) {
|
exec(cmd, (error, stdout) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
lines = stdout.toString().split('\n');
|
lines = stdout.toString().split('\n');
|
||||||
for (let i = 1; i < lines.length; i++) {
|
for (let i = 1; i < lines.length; i++) {
|
||||||
@ -1471,7 +1471,7 @@ function networkStatsSingle(iface) {
|
|||||||
}
|
}
|
||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
cmd = 'ifconfig ' + ifaceSanitized + ' | grep "status"'; // lgtm [js/shell-command-constructed-from-input]
|
cmd = 'ifconfig ' + ifaceSanitized + ' | grep "status"'; // lgtm [js/shell-command-constructed-from-input]
|
||||||
exec(cmd, function (error, stdout) {
|
exec(cmd, (error, stdout) => {
|
||||||
result.operstate = (stdout.toString().split(':')[1] || '').trim();
|
result.operstate = (stdout.toString().split(':')[1] || '').trim();
|
||||||
result.operstate = (result.operstate || '').toLowerCase();
|
result.operstate = (result.operstate || '').toLowerCase();
|
||||||
result.operstate = result.operstate === 'active' ? 'up' : result.operstate === 'inactive' ? 'down' : 'unknown';
|
result.operstate = result.operstate === 'active' ? 'up' : result.operstate === 'inactive' ? 'down' : 'unknown';
|
||||||
@ -1796,11 +1796,11 @@ function networkConnections(callback) {
|
|||||||
if (_windows) {
|
if (_windows) {
|
||||||
let cmd = 'netstat -nao';
|
let cmd = 'netstat -nao';
|
||||||
try {
|
try {
|
||||||
exec(cmd, util.execOptsWin, function (error, stdout) {
|
exec(cmd, util.execOptsWin, (error, stdout) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\r\n');
|
let lines = stdout.toString().split('\r\n');
|
||||||
|
|
||||||
lines.forEach(function (line) {
|
lines.forEach((line) => {
|
||||||
line = line.trim().replace(/ +/g, ' ').split(' ');
|
line = line.trim().replace(/ +/g, ' ').split(' ');
|
||||||
if (line.length >= 4) {
|
if (line.length >= 4) {
|
||||||
let localip = line[1];
|
let localip = line[1];
|
||||||
@ -1902,7 +1902,7 @@ function networkGatewayDefault(callback) {
|
|||||||
if (_linux || _freebsd || _openbsd || _netbsd) {
|
if (_linux || _freebsd || _openbsd || _netbsd) {
|
||||||
let cmd = 'ip route get 1';
|
let cmd = 'ip route get 1';
|
||||||
try {
|
try {
|
||||||
exec(cmd, { maxBuffer: 1024 * 102400 }, function (error, stdout) {
|
exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
let lines = stdout.toString().split('\n');
|
let lines = stdout.toString().split('\n');
|
||||||
const line = lines && lines[0] ? lines[0] : '';
|
const line = lines && lines[0] ? lines[0] : '';
|
||||||
@ -1932,7 +1932,7 @@ function networkGatewayDefault(callback) {
|
|||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
let cmd = 'route -n get default';
|
let cmd = 'route -n get default';
|
||||||
try {
|
try {
|
||||||
exec(cmd, { maxBuffer: 1024 * 102400 }, function (error, stdout) {
|
exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
const lines = stdout
|
const lines = stdout
|
||||||
.toString()
|
.toString()
|
||||||
@ -1942,7 +1942,7 @@ function networkGatewayDefault(callback) {
|
|||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
cmd = "netstat -rn | awk '/default/ {print $2}'";
|
cmd = "netstat -rn | awk '/default/ {print $2}'";
|
||||||
exec(cmd, { maxBuffer: 1024 * 102400 }, function (error, stdout) {
|
exec(cmd, { maxBuffer: 1024 * 102400 }, (error, stdout) => {
|
||||||
const lines = stdout
|
const lines = stdout
|
||||||
.toString()
|
.toString()
|
||||||
.split('\n')
|
.split('\n')
|
||||||
@ -1971,7 +1971,7 @@ function networkGatewayDefault(callback) {
|
|||||||
}
|
}
|
||||||
if (_windows) {
|
if (_windows) {
|
||||||
try {
|
try {
|
||||||
exec('netstat -r', util.execOptsWin, function (error, stdout) {
|
exec('netstat -r', util.execOptsWin, (error, stdout) => {
|
||||||
const lines = stdout.toString().split(os.EOL);
|
const lines = stdout.toString().split(os.EOL);
|
||||||
lines.forEach((line) => {
|
lines.forEach((line) => {
|
||||||
line = line.replace(/\s+/g, ' ').trim();
|
line = line.replace(/\s+/g, ' ').trim();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user