networkConnections: wip ss fix (linux)
This commit is contained in:
parent
151817432e
commit
f2382efb21
@ -1679,12 +1679,22 @@ function networkConnections(callback) {
|
||||
let pid = null;
|
||||
let process = '';
|
||||
if (line.length >= 7 && line[6].indexOf('users:') > -1) {
|
||||
const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(',');
|
||||
const proc = line[6].replace('users:(("', '').replace(/"/g, '').replace('pid=', '').split(',');
|
||||
if (proc.length > 2) {
|
||||
process = proc[0].split(' ')[0].split(':')[0];
|
||||
pid = parseInt(proc[1], 10);
|
||||
process = proc[0];
|
||||
const pidValue = parseInt(proc[1], 10);
|
||||
if (pidValue > 0) {
|
||||
pid = pidValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (line.length >= 7 && line[6].indexOf('users:') > -1) {
|
||||
// const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(',');
|
||||
// if (proc.length > 2) {
|
||||
// process = proc[0].split(' ')[0].split(':')[0];
|
||||
// pid = parseInt(proc[1], 10);
|
||||
// }
|
||||
// }
|
||||
if (connstate) {
|
||||
result.push({
|
||||
protocol: line[0],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user