Do not show error on dhcp status

This commit is contained in:
ricardopolo 2019-11-01 10:19:48 -05:00
parent 4ad657dc65
commit bc335781fe

View File

@ -326,11 +326,10 @@ function getInterfaceConnectionName(interfaceName) {
}
function getDHCPstatus(connectionName) {
if(connectionName) {
const cmd = `nmcli connection show "${connectionName}" \| grep ipv4.method;`;
try {
console.log(1);
const result = execSync(cmd).toString();
console.log(2);
const resultFormat = result.replace(/\s+/g,' ').trim();
let dhcStatus = resultFormat.split(" ").slice(1).toString();
@ -347,6 +346,9 @@ function getDHCPstatus(connectionName) {
} catch (e) {
return 'Unknow';
}
} else {
return 'Unknow';
}
}