mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 16:21:01 +00:00
Add a CLI command that blocks until Asterisk has fully booted.
Review: https://reviewboard.asterisk.org/r/684/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267138 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
24
main/cli.c
24
main/cli.c
@@ -1557,6 +1557,28 @@ static char *group_show_channels(struct ast_cli_entry *e, int cmd, struct ast_cl
|
|||||||
#undef FORMAT_STRING
|
#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 char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
|
||||||
|
|
||||||
static struct ast_cli_entry cli_cli[] = {
|
static struct ast_cli_entry cli_cli[] = {
|
||||||
@@ -1600,6 +1622,8 @@ static struct ast_cli_entry cli_cli[] = {
|
|||||||
AST_CLI_DEFINE(handle_cli_show_permissions, "Show CLI permissions"),
|
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_check_permissions, "Try a permissions config for a user"),
|
||||||
|
|
||||||
|
AST_CLI_DEFINE(handle_cli_wait_fullybooted, "Wait for Asterisk to be fully booted"),
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Reference in New Issue
Block a user