networkInterfaces() added dhcp for mac os, added dhcp linux fallback

This commit is contained in:
Sebastian Hildebrandt
2020-01-07 18:17:08 +01:00
parent b0308d4efb
commit 132ac4ffba
6 changed files with 18 additions and 12 deletions
+2 -2
View File
@@ -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);
}
}