Updating the running config as well as the file
This commit is contained in:
@@ -69,16 +69,20 @@ exports.checkConfig = async function checkConfig() {
|
||||
if (!config.clientConfig.ip) {
|
||||
const ipAddr = await checkLocalIP();
|
||||
updateConfig('ip', ipAddr);
|
||||
config.clientConfig.ip = ipAddr;
|
||||
}
|
||||
|
||||
if(!config.clientConfig.name) {
|
||||
const lastOctet = await String(checkLocalIP()).spit('.')[-1];
|
||||
const clientName = `Radio-Node-${lastOctet}`;
|
||||
updateConfig('name', clientName);
|
||||
config.clientConfig.name = clientName;
|
||||
}
|
||||
|
||||
if(!config.clientConfig.port) {
|
||||
updateConfig('port', 3010);
|
||||
const port = 3010;
|
||||
updateConfig('port', port);
|
||||
config.clientConfig.port = port;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user