summaryrefslogtreecommitdiff
path: root/accel-pptpd/cli/std_cmd.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2010-12-19 10:35:14 +0300
committerDmitry Kozlov <xeb@mail.ru>2010-12-19 10:35:14 +0300
commitaff9ec94d82bb46235da0b4be1b2e5e9c9dafbc2 (patch)
treeabda301fed7d9851727e5fdd10d7635b6eb3d6cb /accel-pptpd/cli/std_cmd.c
parente8507d40aa9d55eb3af6196584bf3118d4f08050 (diff)
downloadaccel-ppp-xebd-aff9ec94d82bb46235da0b4be1b2e5e9c9dafbc2.tar.gz
accel-ppp-xebd-aff9ec94d82bb46235da0b4be1b2e5e9c9dafbc2.zip
cli: shutdown cancel command
Diffstat (limited to 'accel-pptpd/cli/std_cmd.c')
-rw-r--r--accel-pptpd/cli/std_cmd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/accel-pptpd/cli/std_cmd.c b/accel-pptpd/cli/std_cmd.c
index 2ff7728..f7e4b65 100644
--- a/accel-pptpd/cli/std_cmd.c
+++ b/accel-pptpd/cli/std_cmd.c
@@ -299,10 +299,11 @@ static void terminate_help(char * const *fields, int fields_cnt, void *client)
static void shutdown_help(char * const *fields, int fields_cnt, void *client)
{
- cli_send(client, "shutdown [soft|hard]- shutdown daemon\r\n");
+ cli_send(client, "shutdown [soft|hard|cancel]- shutdown daemon\r\n");
cli_send(client, "\t\tdefault action - send termination signals to all clients and wait everybody disconnects\r\n");
cli_send(client, "\t\tsoft - wait until all clients disconnects, don't accept new connections\r\n");
cli_send(client, "\t\thard - shutdown now, don't wait anything\r\n");
+ cli_send(client, "\t\tcancel - cancel 'shutdown soft' and return to normal operation\r\n");
}
static int shutdown_exec(const char *cmd, char * const *f, int f_cnt, void *cli)
@@ -312,15 +313,18 @@ static int shutdown_exec(const char *cmd, char * const *f, int f_cnt, void *cli)
if (f_cnt == 2) {
if (!strcmp(f[1], "soft")) {
- triton_event_fire(EV_SHUTDOWN_SOFT, NULL);
+ ppp_shutdown_soft();
return CLI_CMD_OK;
} else if (!strcmp(f[1], "hard"))
hard = 1;
- else
+ else if (!strcmp(f[1], "cancel")) {
+ ppp_shutdown = 0;
+ return CLI_CMD_OK;
+ } else
return CLI_CMD_SYNTAX;
}
- triton_event_fire(EV_SHUTDOWN_SOFT, NULL);
+ ppp_shutdown_soft();
pthread_rwlock_rdlock(&ppp_lock);
list_for_each_entry(ppp, &ppp_list, entry) {