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