diff options
author | xebd <xeb@mail.ru> | 2021-05-24 15:50:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-24 15:50:39 +0300 |
commit | 2cd9ffe9086415fcc934001048b40f4a005aadcc (patch) | |
tree | 1f074f1472efb8a25198366463aa979fe553205c /accel-pppd | |
parent | 84f66a4db569e6b6ae0a7e1092d4dde4e664d5ff (diff) | |
parent | 4b52c1a3590b43ca892c460d9b1478e1da742156 (diff) | |
download | accel-ppp-xebd-2cd9ffe9086415fcc934001048b40f4a005aadcc.tar.gz accel-ppp-xebd-2cd9ffe9086415fcc934001048b40f4a005aadcc.zip |
Merge pull request #15 from Joes-Madness/cli_show_version
cli: T40: Show version of running accel-pppd from cli or telnet
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/cli/std_cmd.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c index e752918..e22ea76 100644 --- a/accel-pppd/cli/std_cmd.c +++ b/accel-pppd/cli/std_cmd.c @@ -84,6 +84,17 @@ static void show_stat_help(char * const *fields, int fields_cnt, void *client) } //============================= +static int show_version_exec(const char *cmd, char * const *fields, int fields_cnt, void *client) +{ + cli_sendv(client, "%s\r\n", ACCEL_PPP_VERSION); +} + +static void show_version_help(char * const *fields, int fields_cnt, void *client) +{ + cli_send(client, "show version - shows version of running accel-pppd\r\n"); +} +//============================= + static int exit_exec(const char *cmd, char * const *fields, int fields_cnt, void *client) { return CLI_CMD_EXIT; @@ -381,6 +392,7 @@ static void restart_help(char * const *fields, int fields_cnt, void *client) static void init(void) { cli_register_simple_cmd2(show_stat_exec, show_stat_help, 2, "show", "stat"); + cli_register_simple_cmd2(show_version_exec, show_version_help, 2, "show", "version"); cli_register_simple_cmd2(terminate_exec, terminate_help, 1, "terminate"); cli_register_simple_cmd2(reload_exec, reload_help, 1, "reload"); cli_register_simple_cmd2(restart_exec, restart_help, 1, "restart"); |