From 9106a750cd76d4a76c7a60294ce3a43eede166c9 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Wed, 12 Jun 2019 16:13:21 +0200 Subject: Add CLI command to test reconfiguration status Based on patch from Kenth Eriksson . --- conf/conf.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'conf/conf.c') diff --git a/conf/conf.c b/conf/conf.c index 439aa41d..d6b3e8e8 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -444,6 +444,24 @@ config_undo(void) return CONF_PROGRESS; } +int +config_status(void) +{ + if (shutting_down) + return CONF_SHUTDOWN; + + if (configuring) + return future_cftype ? CONF_QUEUED : CONF_PROGRESS; + + return CONF_DONE; +} + +btime +config_timer_status(void) +{ + return tm_active(config_timer) ? tm_remains(config_timer) : -1; +} + extern void cmd_reconfig_undo_notify(void); static void -- cgit v1.2.3