Expand admin SSH command capabilities

Add per-session history, tab completion, interactive prompts, and
bounded input handling. Support deferred lifecycle and host-key actions
after output drains, and document the expanded administration workflow.
This commit is contained in:
2026-08-30 18:34:01 +02:00
parent 0a1bbd6782
commit c2c11fee4e
14 changed files with 699 additions and 224 deletions
+10
View File
@@ -6,6 +6,7 @@
#include <stdint.h>
#include <stdio.h>
#include "admin_ssh_console.h"
#include "esp_console.h"
#include "esp_heap_caps.h"
#include "esp_system.h"
@@ -47,6 +48,15 @@ static int command_reboot(int argc, char **argv)
return 1;
}
if (admin_ssh_console_dispatch_is_remote()) {
esp_err_t error = admin_ssh_console_dispatch_defer(ADMIN_SSH_DEFER_REBOOT, 0U);
if (error != ESP_OK) {
printf("Could not schedule reboot: %s\n", esp_err_to_name(error));
return 1;
}
printf("Reboot scheduled after SSH output drains; unsaved changes will be lost.\n");
return 0;
}
printf("Rebooting now; unsaved RAM-only configuration changes will be lost.\n");
fflush(stdout);
/* Give the UART driver time to transmit the acknowledgement before reset. */