diff options
author | Renato Westphal <renato@opensourcerouting.org> | 2019-11-12 17:39:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-12 17:39:46 +0100 |
commit | 220e485b4d5f2bee07caf2ad698f18e4807dc380 (patch) | |
tree | c72af93c0df5a6e693b110979456e8830deabb06 /vtysh | |
parent | Merge pull request #5302 from qlyoung/static-stnradsjfsacasecmppnullLLL000 (diff) | |
parent | doc: Add `banner motd <file|line>` sections (diff) | |
download | frr-220e485b4d5f2bee07caf2ad698f18e4807dc380.tar.xz frr-220e485b4d5f2bee07caf2ad698f18e4807dc380.zip |
Merge pull request #5209 from ton31337/feature/banner_motd_from_input
vtysh: Add an option to set banner motd from an input
Diffstat (limited to 'vtysh')
-rw-r--r-- | vtysh/vtysh_user.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c index 17e5a7331..a7067984c 100644 --- a/vtysh/vtysh_user.c +++ b/vtysh/vtysh_user.c @@ -147,6 +147,26 @@ DEFUN (vtysh_banner_motd_file, return cmd_banner_motd_file(argv[idx_file]->arg); } +DEFUN (vtysh_banner_motd_line, + vtysh_banner_motd_line_cmd, + "banner motd line LINE...", + "Set banner\n" + "Banner for motd\n" + "Banner from an input\n" + "Text\n") +{ + int idx = 0; + char *motd; + + argv_find(argv, argc, "LINE", &idx); + motd = argv_concat(argv, argc, idx); + + cmd_banner_motd_line(motd); + XFREE(MTYPE_TMP, motd); + + return CMD_SUCCESS; +} + DEFUN (username_nopassword, username_nopassword_cmd, "username WORD nopassword", @@ -203,4 +223,5 @@ void vtysh_user_init(void) userlist = list_new(); install_element(CONFIG_NODE, &username_nopassword_cmd); install_element(CONFIG_NODE, &vtysh_banner_motd_file_cmd); + install_element(CONFIG_NODE, &vtysh_banner_motd_line_cmd); } |