diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-06-12 16:13:21 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2019-06-12 17:15:35 +0200 |
commit | 9106a750cd76d4a76c7a60294ce3a43eede166c9 (patch) | |
tree | 507177651bf4654e714665a6f2e3ab1ed330e1cf /sysdep/unix/main.c | |
parent | 8a2cbb88d1657b4aee366605cb3d8ffcc5d3f90a (diff) |
Add CLI command to test reconfiguration status
Based on patch from Kenth Eriksson <kenth.eriksson@infinera.com>.
Diffstat (limited to 'sysdep/unix/main.c')
-rw-r--r-- | sysdep/unix/main.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 921115b1..c381b44f 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -339,6 +339,28 @@ cmd_reconfig_undo(void) cmd_reconfig_msg(r); } +void +cmd_reconfig_status(void) +{ + int s = config_status(); + btime t = config_timer_status(); + + switch (s) + { + case CONF_DONE: cli_msg(-3, "Daemon is up and running"); break; + case CONF_PROGRESS: cli_msg(-4, "Reconfiguration in progress"); break; + case CONF_QUEUED: cli_msg(-5, "Reconfiguration in progress, next one enqueued"); break; + case CONF_SHUTDOWN: cli_msg(-6, "Shutdown in progress"); break; + default: break; + } + + if (t >= 0) + cli_msg(-22, "Configuration unconfirmed, undo in %t s", t); + + cli_msg(0, ""); +} + + /* * Command-Line Interface */ |