Get 802.1x authentication method
This commit is contained in:
parent
86389999de
commit
bd7e69be9b
@ -436,6 +436,22 @@ function getLinuxIfaceDNSsuffix(connectionName) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getLinuxIfaceAuthProtocol(connectionName) {
|
||||||
|
if(connectionName) {
|
||||||
|
const cmd = `nmcli connection show "${connectionName}" \| grep 802-1x.eap;`;
|
||||||
|
try {
|
||||||
|
const result = execSync(cmd).toString();
|
||||||
|
const resultFormat = result.replace(/\s+/g,' ').trim();
|
||||||
|
const authenticationProtocol = resultFormat.split(" ").slice(1).toString();
|
||||||
|
return authenticationProtocol == '--' ? '': authenticationProtocol;
|
||||||
|
} catch (e) {
|
||||||
|
return 'Not configured';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 'Not configured';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function testVirtualNic(iface, ifaceName, mac) {
|
function testVirtualNic(iface, ifaceName, mac) {
|
||||||
const virtualMacs = ['00:00:00:00:00:00', '00:03:FF', '00:05:69', '00:0C:29', '00:0F:4B', '00:0F:4B', '00:13:07', '00:13:BE', '00:15:5d', '00:16:3E', '00:1C:42', '00:21:F6', '00:21:F6', '00:24:0B', '00:24:0B', '00:50:56', '00:A0:B1', '00:E0:C8', '08:00:27', '0A:00:27', '18:92:2C', '16:DF:49', '3C:F3:92', '54:52:00', 'FC:15:97'];
|
const virtualMacs = ['00:00:00:00:00:00', '00:03:FF', '00:05:69', '00:0C:29', '00:0F:4B', '00:0F:4B', '00:13:07', '00:13:BE', '00:15:5d', '00:16:3E', '00:1C:42', '00:21:F6', '00:21:F6', '00:24:0B', '00:24:0B', '00:50:56', '00:A0:B1', '00:E0:C8', '08:00:27', '0A:00:27', '18:92:2C', '16:DF:49', '3C:F3:92', '54:52:00', 'FC:15:97'];
|
||||||
if (mac) {
|
if (mac) {
|
||||||
@ -507,6 +523,7 @@ function networkInterfaces(callback) {
|
|||||||
let operstate = 'down';
|
let operstate = 'down';
|
||||||
let dhcp = false;
|
let dhcp = false;
|
||||||
let dnsSuffix = '';
|
let dnsSuffix = '';
|
||||||
|
let authMethod = '';
|
||||||
let type = '';
|
let type = '';
|
||||||
|
|
||||||
if (ifaces.hasOwnProperty(dev)) {
|
if (ifaces.hasOwnProperty(dev)) {
|
||||||
@ -563,6 +580,7 @@ function networkInterfaces(callback) {
|
|||||||
const connectionName = getLinuxIfaceConnectionName(iface);
|
const connectionName = getLinuxIfaceConnectionName(iface);
|
||||||
dhcp = getLinuxIfaceDHCPstatus(connectionName);
|
dhcp = getLinuxIfaceDHCPstatus(connectionName);
|
||||||
dnsSuffix = getLinuxIfaceDNSsuffix(connectionName);
|
dnsSuffix = getLinuxIfaceDNSsuffix(connectionName);
|
||||||
|
authMethod = getLinuxIfaceAuthProtocol(connectionName);
|
||||||
lines = execSync(cmd).toString().split('\n');
|
lines = execSync(cmd).toString().split('\n');
|
||||||
|
|
||||||
|
|
||||||
@ -585,6 +603,7 @@ function networkInterfaces(callback) {
|
|||||||
if (iface === 'lo' || iface.startsWith('bond')) { type = 'virtual'; }
|
if (iface === 'lo' || iface.startsWith('bond')) { type = 'virtual'; }
|
||||||
}
|
}
|
||||||
if (_windows) {
|
if (_windows) {
|
||||||
|
authMethod = 'Unknow';
|
||||||
dnsSuffix = getWindowsIfaceDNSsuffix(dnsSuffixes.ifaces, dev);
|
dnsSuffix = getWindowsIfaceDNSsuffix(dnsSuffixes.ifaces, dev);
|
||||||
nics.forEach(detail => {
|
nics.forEach(detail => {
|
||||||
if (detail.mac === mac) {
|
if (detail.mac === mac) {
|
||||||
@ -616,6 +635,7 @@ function networkInterfaces(callback) {
|
|||||||
speed,
|
speed,
|
||||||
dhcp,
|
dhcp,
|
||||||
dnsSuffix,
|
dnsSuffix,
|
||||||
|
authMethod,
|
||||||
carrierChanges,
|
carrierChanges,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user