networkInterfaces() added dhcp for mac os, added dhcp linux fallback
This commit is contained in:
+2
-2
@@ -503,7 +503,7 @@ function getLinuxDHCPNics() {
|
||||
lines.forEach(line => {
|
||||
const parts = line.replace(/\s+/g, ' ').trim().split(' ');
|
||||
if (parts.length >=4) {
|
||||
if (line.toLowerCase().indexOf('dynamic') >= 0) {
|
||||
if (line.toLowerCase().indexOf(' inet ') >= 0 && line.toLowerCase().indexOf('dhcp') >= 0) {
|
||||
result.push(parts[1]);
|
||||
}
|
||||
}
|
||||
@@ -559,7 +559,7 @@ function getLinuxIfaceDHCPstatus(iface, connectionName, DHCPNics) {
|
||||
return (DHCPNics.indexOf(iface) >= 0);
|
||||
}
|
||||
} else {
|
||||
return result;
|
||||
return (DHCPNics.indexOf(iface) >= 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user