@@ -242,28 +242,23 @@ t_cliResult processCommand(char *cmdBuffer)
242
242
}
243
243
else
244
244
{
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 )
251
246
{
252
247
commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
253
248
// TODO - Do an apply...
254
249
return (CLI_OK);
255
250
}
256
- else if (strcmp (tokens[1 ], " SAVE " ) == 0 )
251
+ else if (strcmp (tokens[1 ], " EXIT " ) == 0 )
257
252
{
258
- recordSystemSettings ();
259
253
commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
260
- return (CLI_OK );
254
+ return (CLI_EXIT );
261
255
}
262
- else if (strcmp (tokens[1 ], " REBOOT " ) == 0 )
256
+ else if (strcmp (tokens[1 ], " FACTORYRESET " ) == 0 )
263
257
{
258
+ // Apply factory defaults, then reset
264
259
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.
267
262
}
268
263
else if (strcmp (tokens[1 ], " LIST" ) == 0 )
269
264
{
@@ -286,12 +281,17 @@ t_cliResult processCommand(char *cmdBuffer)
286
281
commandSendExecuteOkResponse (tokens[0 ], tokens[1 ]);
287
282
return (CLI_OK);
288
283
}
289
- else if (strcmp (tokens[1 ], " FACTORYRESET " ) == 0 )
284
+ else if (strcmp (tokens[1 ], " REBOOT " ) == 0 )
290
285
{
291
- // Apply factory defaults, then reset
292
286
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);
295
295
}
296
296
else if (strcmp (tokens[1 ], " UPDATEFIRMWARE" ) == 0 )
297
297
{
0 commit comments