Bug with whitespaces

This commit is contained in:
Logan Cusano
2023-05-06 17:04:17 -04:00
parent 35b81758e3
commit a14c56b645

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, "").replace(/[\s]/g, "-").trim(); line[0] = String(line[0]).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['IPv4Address']);
return networkConfigLines['IPv4-Address']; return networkConfigLines['IPv4Address'];
} }
else { else {
// Linux // Linux