Do not show error on dhcp status
This commit is contained in:
parent
4ad657dc65
commit
bc335781fe
@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user