code cleanup
This commit is contained in:
parent
0164a65c20
commit
b35b851a85
@ -505,7 +505,7 @@ function getLinuxDHCPNics() {
|
||||
const lines = execSync(cmd, { maxBuffer: 1024 * 20000 }).toString().split('\n');
|
||||
lines.forEach(line => {
|
||||
const parts = line.replace(/\s+/g, ' ').trim().split(' ');
|
||||
if (parts.length >=4) {
|
||||
if (parts.length >= 4) {
|
||||
if (line.toLowerCase().indexOf(' inet ') >= 0 && line.toLowerCase().indexOf('dhcp') >= 0) {
|
||||
result.push(parts[1]);
|
||||
}
|
||||
@ -549,13 +549,13 @@ function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {
|
||||
|
||||
let dhcStatus = resultFormat.split(' ').slice(1).toString();
|
||||
switch (dhcStatus) {
|
||||
case 'auto':
|
||||
result = true;
|
||||
break;
|
||||
case 'auto':
|
||||
result = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
} catch (e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user