]> git.ipfire.org Git - thirdparty/bird.git/blobdiff - sysdep/unix/main.c
Merge branch 'master' into mq-filter-stack
[thirdparty/bird.git] / sysdep / unix / main.c
index b0d764fa0ae2791e0bfda05e5ec0ea4413d26f8d..05becbe75f6a57c84c69b84aa92803458db44225 100644 (file)
@@ -338,6 +338,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
  */
@@ -542,14 +564,14 @@ cmd_shutdown(void)
     return;
 
   cli_msg(7, "Shutdown requested");
-  order_shutdown();
+  order_shutdown(0);
 }
 
 void
 async_shutdown(void)
 {
   DBG("Shutting down...\n");
-  order_shutdown();
+  order_shutdown(0);
 }
 
 void
@@ -561,6 +583,17 @@ sysdep_shutdown_done(void)
   exit(0);
 }
 
+void
+cmd_graceful_restart(void)
+{
+  if (cli_access_restricted())
+    return;
+
+  cli_msg(25, "Graceful restart requested");
+  order_shutdown(1);
+}
+
+
 /*
  *     Signals
  */