fix networkConnections()
This commit is contained in:
parent
8a801aec95
commit
7eb83e2565
2
2
2
2
@ -1,2 +0,0 @@
|
||||
WARNING: The airport command line tool is deprecated and will be removed in a future release.
|
||||
For diagnosing Wi-Fi related issues, use the Wireless Diagnostics app or wdutil command line tool.
|
||||
@ -90,7 +90,8 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
|
||||
|
||||
| Version | Date | Comment |
|
||||
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
|
||||
| 5.23.16 | 2024-12-13 | `networkConnections()` refactored PID parsing (macOS) |
|
||||
| 5.23.17 | 2024-12-23 | `wifiConnections()` refactored - Sequoia compatibel (macOS) |
|
||||
| 5.23.16 | 2024-12-22 | `networkConnections()` refactored PID parsing (macOS) |
|
||||
| 5.23.15 | 2024-12-21 | `users()`, `wifiNetworks()` fixed parsing (macOS Seguoia) |
|
||||
| 5.23.14 | 2024-12-18 | `chassis()` new chassis detection (macOS) |
|
||||
| 5.23.13 | 2024-12-14 | `wifiConnections()` improved BSSID parsing (windows) |
|
||||
|
||||
@ -57,6 +57,11 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">5.23.17</th>
|
||||
<td>2024-12-23</td>
|
||||
<td><span class="code">wifiConnections()</span> refactored - Sequoia compatibel (macOS)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">5.23.16</th>
|
||||
<td>2024-12-22</td>
|
||||
|
||||
@ -170,7 +170,7 @@
|
||||
<img class="logo" src="assets/logo.png" alt="logo">
|
||||
<div class="title">systeminformation</div>
|
||||
<div class="subtitle"><span id="typed"></span> </div>
|
||||
<div class="version">New Version: <span id="version">5.23.16</span></div>
|
||||
<div class="version">New Version: <span id="version">5.23.17</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>
|
||||
</div>
|
||||
<div class="down">
|
||||
|
||||
@ -1535,7 +1535,7 @@ function networkConnections(callback) {
|
||||
});
|
||||
}
|
||||
if (_darwin) {
|
||||
let cmd = 'netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"';
|
||||
let cmd = 'netstat -natvln | head -n2; netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"';
|
||||
const states = 'ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT_1|FIN_WAIT2|FIN_WAIT_2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN'.split('|');
|
||||
exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {
|
||||
if (!error) {
|
||||
@ -1543,15 +1543,9 @@ function networkConnections(callback) {
|
||||
let processes = stdout2.toString().split('\n');
|
||||
processes = processes.map((line => { return line.trim().replace(/ +/g, ' '); }));
|
||||
let lines = stdout.toString().split('\n');
|
||||
let pidPos = 8;
|
||||
if (lines[0] !== '') {
|
||||
const lineParts = lines[0].replace(/ +/g, ' ').split(' ');
|
||||
for (let i = 0; i < lineParts.length; i++) {
|
||||
if (states.indexOf(lineParts[i]) >= 0) {
|
||||
pidPos = i + 3;
|
||||
}
|
||||
};
|
||||
}
|
||||
lines.shift();
|
||||
const header = lines.shift().replace(/ Address/g, '_Address').replace(/ +/g, ' ').split(' ');
|
||||
let pidPos = header.indexOf('pid');
|
||||
lines.forEach(function (line) {
|
||||
line = line.replace(/ +/g, ' ').split(' ');
|
||||
if (line.length >= 8) {
|
||||
|
||||
@ -176,7 +176,7 @@ function ifaceListLinux() {
|
||||
}
|
||||
|
||||
function nmiDeviceLinux(iface) {
|
||||
const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2>/dev/null`;
|
||||
const cmd = `nmcli -t -f general,wifi-properties,capabilities,ip4,ip6 device show ${iface} 2> /dev/null`;
|
||||
try {
|
||||
const lines = execSync(cmd, util.execOptsLinux).toString().split('\n');
|
||||
const ssid = util.getValue(lines, 'GENERAL.CONNECTION');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user