Update client startup for new nodes

- Still needs to get IP from linux nodes
- Other tasks still, idk
This commit is contained in:
Logan Cusano
2023-06-19 00:05:27 -04:00
parent d96e6ad519
commit 93be4ca9dc
4 changed files with 41 additions and 20 deletions

View File

@@ -261,4 +261,24 @@ function convertRadioPresetsToOP25Config(presetName){
log.DEBUG(updatedOP25Config);
return updatedOP25Config;
}
}
// Convert a buffer from the DB to JSON object
exports.BufferToJson = (buffer) => {
return JSON.parse(buffer.toString());
}
/**
* Check to see if the input is a valid JSON string
*
* @param {*} str The string to check for valud JSON
* @returns {true|false}
*/
exports.isJsonString = (str) => {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}