removes save option
authorJosé Bollo <jose.bollo@iot.bzh>
Wed, 23 Mar 2016 12:05:25 +0000 (13:05 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Wed, 23 Mar 2016 12:18:24 +0000 (13:18 +0100)
Change-Id: I2a935739985574f9463bf25884254a4ace3b4938
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
include/local-def.h
src/main.c

index 44f2142..df4ddb2 100644 (file)
@@ -242,11 +242,9 @@ typedef struct {
   int  killPrevious;
   int  background;        // run in backround mode
   int  foreground;        // run in forground mode
-  int  configsave;        // Save config on disk on start
   char *cacheTimeout;     // http require timeout to be a string
   struct MHD_Daemon *httpd;            // anonymous structure for httpd handler
   int  fakemod;           // respond to GET/POST request without interacting with sndboard
-  int  forceexit;         // when autoconfig from script force exit before starting server
   int  readyfd;           // a #fd to signal when ready to serve
   AFB_plugin **plugins;   // pointer to REST/API plugins 
   magic_t  magic;         // Mime type file magic lib
index 40f28c1..d19f7e0 100644 (file)
@@ -116,8 +116,6 @@ static  AFB_options cliOptions [] = {
   {SET_PID_FILE     ,1,"pidfile"         , "PID file path [default none]"},
   {SET_SESSION_DIR  ,1,"sessiondir"      , "Sessions file path [default rootdir/sessions]"},
   {SET_CONFIG_FILE  ,1,"config"          , "Config Filename [default rootdir/sessions/configs/default.AFB]"},
-  {SET_CONFIG_SAVE  ,0,"save"            , "Save config on disk [default no]"},
-  {SET_CONFIG_EXIT  ,0,"saveonly"        , "Save config on disk and then exit"},
 
   {SET_LDPATH       ,1,"ldpaths"         , "Load Plugins from dir1:dir2:... [default = PLUGIN_INSTALL_DIR"},
   {SET_AUTH_TOKEN   ,1,"token"           , "Initial Secret [default=no-session, --token="" for session without authentication]"},
@@ -394,17 +392,6 @@ static void parse_arguments(int argc, char *argv[], AFB_session *session)
        if (!sscanf (optarg, "%d", &cliconfig.cacheTimeout)) goto notAnInteger;
        break;
 
-    case SET_CONFIG_EXIT:
-       if (optarg != 0) goto noValueForOption;
-       session->configsave  = 1;
-       session->forceexit   = 1;
-       break;
-
-    case SET_CONFIG_SAVE:
-       if (optarg != 0) goto noValueForOption;
-       session->configsave  = 1;
-       break;
-
     case SET_USERID:
        if (optarg == 0) goto needValueForOption;
        cliconfig.setuid = optarg;
@@ -559,9 +546,6 @@ int main(int argc, char *argv[])  {
 
   // ------------------ Finaly Process Commands -----------------------------
    // if --save then store config on disk upfront
-   if (session->configsave) configStoreFile (session);
-   if (session->forceexit)  exit (0);
-
     if (session->config->setuid) {
         int err;
         struct passwd *passwd;