diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-02 18:57:02 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-02 18:57:02 +0000 |
commit | 6e51a54df8bc41f4cb8f24f91938560658645950 (patch) | |
tree | 95b6de53c1c8775a7ee74bd2459a0c929178f2b6 /main | |
parent | cc717afcd1d413fdb18073170dc7c9e53bd2bcb0 (diff) |
Merged revisions 267138 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r267138 | russell | 2010-06-02 13:53:38 -0500 (Wed, 02 Jun 2010) | 4 lines
Add a CLI command that blocks until Asterisk has fully booted.
Review: https://reviewboard.asterisk.org/r/684/
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@267139 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/cli.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/main/cli.c b/main/cli.c index 72e3000e0..8361e4ebd 100644 --- a/main/cli.c +++ b/main/cli.c @@ -1465,6 +1465,28 @@ static char *group_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl #undef FORMAT_STRING } +static char *handle_cli_wait_fullybooted(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) +{ + switch (cmd) { + case CLI_INIT: + e->command = "core waitfullybooted"; + e->usage = + "Usage: core waitfullybooted\n" + " Wait until Asterisk has fully booted.\n"; + return NULL; + case CLI_GENERATE: + return NULL; + } + + while (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) { + usleep(100); + } + + ast_cli(a->fd, "Asterisk has fully booted.\n"); + + return CLI_SUCCESS; +} + static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a); static struct ast_cli_entry cli_cli[] = { @@ -1508,6 +1530,8 @@ static struct ast_cli_entry cli_cli[] = { AST_CLI_DEFINE(handle_cli_show_permissions, "Show CLI permissions"), AST_CLI_DEFINE(handle_cli_check_permissions, "Try a permissions config for a user"), + + AST_CLI_DEFINE(handle_cli_wait_fullybooted, "Wait for Asterisk to be fully booted"), }; /*! |