fix some fool erros
This commit is contained in:
parent
3ef962a830
commit
86389999de
@ -236,8 +236,10 @@ function getWindowsDNSsuffixes() {
|
||||
|
||||
try {
|
||||
const ipconfig = execSync('ipconfig /all', util.execOptsWin);
|
||||
const ipconfigArray = ipconfig.output.split('\r\n\r\n');
|
||||
const ipconfigArray = ipconfig.split('\r\n\r\n');
|
||||
|
||||
ipconfigArray.forEach( (element, index) => {
|
||||
|
||||
if(index == 1) {
|
||||
const longPrimaryDNS = element.split('\r\n').filter((element) => {
|
||||
return element.toUpperCase().includes('DNS');
|
||||
@ -261,9 +263,10 @@ function getWindowsDNSsuffixes() {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return dnsSuffixes;
|
||||
} catch (error) {
|
||||
console.log('An error occurred trying to bring the DNS suffixes of the network ifaces', error.message);
|
||||
console.log('An error occurred trying to bring the Connection-specific DNS suffix', error.message);
|
||||
return {
|
||||
primaryDNS: '',
|
||||
exitCode: 0,
|
||||
@ -282,11 +285,11 @@ function getWindowsIfaceDNSsuffix(ifaces, ifacename) {
|
||||
if(connectionDnsSuffix[0]) {
|
||||
dnsSuffix = connectionDnsSuffix[0];
|
||||
}
|
||||
if(!dnsSuffix) dnsSuffix = 'not defined';
|
||||
if(!dnsSuffix) dnsSuffix = '';
|
||||
return dnsSuffix ;
|
||||
} catch (error) {
|
||||
console.log('Error getting Connection-specific DNS suffix: ', error.message);
|
||||
return '';
|
||||
return 'Unknow';
|
||||
}
|
||||
}
|
||||
|
||||
@ -582,7 +585,7 @@ function networkInterfaces(callback) {
|
||||
if (iface === 'lo' || iface.startsWith('bond')) { type = 'virtual'; }
|
||||
}
|
||||
if (_windows) {
|
||||
dnsSuffix = getWindowsIfaceDNSsuffix(dnsSuffixes.ifaces, detail.name);
|
||||
dnsSuffix = getWindowsIfaceDNSsuffix(dnsSuffixes.ifaces, dev);
|
||||
nics.forEach(detail => {
|
||||
if (detail.mac === mac) {
|
||||
ifaceName = detail.name;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user