Resolved bug updating the config
This commit is contained in:
@@ -51,9 +51,10 @@ async function checkLocalIP() {
|
||||
line[1] = String(line[1]).replace(/(\\r|\\n)/g, "").trim();
|
||||
return line;
|
||||
});
|
||||
log.DEBUG("Parsed IP Config Results: ", networkConfigLines);
|
||||
log.DEBUG("Local IP address: ", networkConfigLines['IPv4Address']);
|
||||
return networkConfigLines['IPv4Address'];
|
||||
networkConfig = Object.fromEntries(networkConfigLines);
|
||||
log.DEBUG("Parsed IP Config Results: ", networkConfig);
|
||||
log.DEBUG("Local IP address: ", networkConfig['IPv4Address']);
|
||||
return networkConfig['IPv4Address'];
|
||||
}
|
||||
else {
|
||||
// Linux
|
||||
@@ -67,17 +68,17 @@ async function checkLocalIP() {
|
||||
exports.checkConfig = async function checkConfig() {
|
||||
if (!config.clientConfig.ip) {
|
||||
const ipAddr = await checkLocalIP();
|
||||
updateConfigFile('ip', ipAddr);
|
||||
updateConfig('ip', ipAddr);
|
||||
}
|
||||
|
||||
if(!config.clientConfig.name) {
|
||||
const lastOctet = await checkLocalIP().spit('.')[-1];
|
||||
const lastOctet = await String(checkLocalIP()).spit('.')[-1];
|
||||
const clientName = `Radio-Node-${lastOctet}`;
|
||||
updateConfigFile('name', clientName);
|
||||
updateConfig('name', clientName);
|
||||
}
|
||||
|
||||
if(!config.clientConfig.port) {
|
||||
updateConfigFile('port', 3010);
|
||||
updateConfig('port', 3010);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user