@@ -242,28 +242,23 @@ t_cliResult processCommand(char *cmdBuffer)
242242 }
243243 else
244244 {
245- if (strcmp (tokens[1 ], " EXIT" ) == 0 )
246- {
247- commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
248- return (CLI_EXIT);
249- }
250- else if (strcmp (tokens[1 ], " APPLY" ) == 0 )
245+ if (strcmp (tokens[1 ], " APPLY" ) == 0 )
251246 {
252247 commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
253248 // TODO - Do an apply...
254249 return (CLI_OK);
255250 }
256- else if (strcmp (tokens[1 ], " SAVE " ) == 0 )
251+ else if (strcmp (tokens[1 ], " EXIT " ) == 0 )
257252 {
258- recordSystemSettings ();
259253 commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
260- return (CLI_OK );
254+ return (CLI_EXIT );
261255 }
262- else if (strcmp (tokens[1 ], " REBOOT " ) == 0 )
256+ else if (strcmp (tokens[1 ], " FACTORYRESET " ) == 0 )
263257 {
258+ // Apply factory defaults, then reset
264259 commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
265- delay ( 50 ); // Allow for final print
266- ESP. restart ();
260+ factoryReset ( false ); // We do not have the SD semaphore
261+ return (CLI_OK); // We should never get this far.
267262 }
268263 else if (strcmp (tokens[1 ], " LIST" ) == 0 )
269264 {
@@ -286,12 +281,17 @@ t_cliResult processCommand(char *cmdBuffer)
286281 commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
287282 return (CLI_OK);
288283 }
289- else if (strcmp (tokens[1 ], " FACTORYRESET " ) == 0 )
284+ else if (strcmp (tokens[1 ], " REBOOT " ) == 0 )
290285 {
291- // Apply factory defaults, then reset
292286 commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
293- factoryReset (false ); // We do not have the SD semaphore
294- return (CLI_OK); // We should never get this far.
287+ delay (50 ); // Allow for final print
288+ ESP.restart ();
289+ }
290+ else if (strcmp (tokens[1 ], " SAVE" ) == 0 )
291+ {
292+ recordSystemSettings ();
293+ commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
294+ return (CLI_OK);
295295 }
296296 else if (strcmp (tokens[1 ], " UPDATEFIRMWARE" ) == 0 )
297297 {
0 commit comments