]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vtysh: add motd command
authorSergei Rozhkov <gh@zserg.ru>
Mon, 28 Nov 2022 11:14:25 +0000 (16:14 +0500)
committerSergei Rozhkov <gh@zserg.ru>
Wed, 30 Nov 2022 04:43:55 +0000 (09:43 +0500)
Add "show motd" commad.
The vtysh user can call the "show motd" command to re-show the welcome message.
This is necessary if the user saves frequently used commands in motd.

Signed-off-by: Sergei Rozhkov <gh@zserg.ru>
doc/user/basic.rst
vtysh/vtysh.c

index 7679a377eb5fc5dffc30abdf05b8c8a136353fec..4a64d8f949ed48aada9902a597d7033f8b609b3e 100644 (file)
@@ -617,6 +617,10 @@ Terminal Mode Commands
    usage is printed sequentially. You can specify the daemon's name to print
    only its memory usage.
 
+.. clicmd:: show motd
+
+   Show current motd banner.
+
 .. clicmd:: show history
 
    Dump the vtysh cli history.
index 30f117505a5e11c3b2b8488d311154213ff7110b..dea09fa151a889ad80abf880d38e26fd25df89b0 100644 (file)
@@ -3939,6 +3939,12 @@ DEFUN (vtysh_ping,
        return CMD_SUCCESS;
 }
 
+DEFUN(vtysh_motd, vtysh_motd_cmd, "show motd", SHOW_STR "Show motd\n")
+{
+       vty_hello(vty);
+       return CMD_SUCCESS;
+}
+
 ALIAS(vtysh_ping, vtysh_ping_ip_cmd, "ping ip WORD",
       "Send echo messages\n"
       "IP echo\n"
@@ -4907,6 +4913,7 @@ void vtysh_init_vty(void)
        install_element(VIEW_NODE, &no_vtysh_terminal_monitor_cmd);
 
        install_element(VIEW_NODE, &vtysh_ping_cmd);
+       install_element(VIEW_NODE, &vtysh_motd_cmd);
        install_element(VIEW_NODE, &vtysh_ping_ip_cmd);
        install_element(VIEW_NODE, &vtysh_traceroute_cmd);
        install_element(VIEW_NODE, &vtysh_traceroute_ip_cmd);