update mode added. need to fix why udpatemode get and set not in allowed functions

This commit is contained in:
2021-11-12 17:18:26 +01:00
parent 0ffd30e147
commit eb69d7cb69
13 changed files with 255 additions and 48 deletions

View File

@ -4,6 +4,7 @@
The port number is passed as an argument */
#include "clogger.h"
#include "common.h"
#include "communication_funcs.h"
#include "sharedMemory.h"
#include "sls/sls_detector_defs.h"
@ -48,6 +49,18 @@ int main(int argc, char *argv[]) {
checkModuleFlag = 1;
int version = 0;
// update flag if update file exists (command line arg overwrites)
const int fileNameSize = 128;
char fname[fileNameSize];
if (getAbsPath(fname, fileNameSize, UPDATE_FILE) == FAIL) {
LOG(logERROR, ("Could not get abs path to check if update file exists. "
"Will try current folder instead.\n"));
strcpy(fname, UPDATE_FILE);
}
if (access(fname, F_OK) == 0) {
updateFlag = 1;
}
// help message
char helpMessage[MAX_STR_LENGTH];
memset(helpMessage, 0, MAX_STR_LENGTH);