Bug in getting the IP address on windows

This commit is contained in:
Logan Cusano
2023-05-06 16:44:39 -04:00
parent 7871b07113
commit 35b81758e3

View File

@@ -47,13 +47,13 @@ async function checkLocalIP() {
return true; return true;
}).map(line => { }).map(line => {
line = String(line).split(':', 2); line = String(line).split(':', 2);
line[0] = String(line[0]).replace(/[.]/g, "").trim(); line[0] = String(line[0]).replace(/[.]/g, "").replace(/[\s]/g, "-").trim();
line[1] = String(line[1]).replace(/(\\r|\\n)/g, "").trim(); line[1] = String(line[1]).replace(/(\\r|\\n)/g, "").trim();
return line; return line;
}); });
log.DEBUG("Parsed IP Config Results: ", networkConfigLines); log.DEBUG("Parsed IP Config Results: ", networkConfigLines);
log.DEBUG("Local IP address: ", networkConfigLines['IPv4 Address']); log.DEBUG("Local IP address: ", networkConfigLines['IPv4-Address']);
return networkConfigLines['IPv4 Address']; return networkConfigLines['IPv4-Address'];
} }
else { else {
// Linux // Linux