Code was already in place to read and display a motd, but
no cli was present to make it happen. Add the cli
back to vtysh.conf.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
return CMD_SUCCESS;
}
+int
+cmd_banner_motd_file (const char *file)
+{
+ if (host.motdfile)
+ XFREE (MTYPE_HOST, host.motdfile);
+ host.motdfile = XSTRDUP (MTYPE_HOST, file);
+
+ return CMD_SUCCESS;
+}
+
DEFUN (banner_motd_file,
banner_motd_file_cmd,
"banner motd file [FILE]",
"Banner from a file\n"
"Filename\n")
{
- if (host.motdfile)
- XFREE (MTYPE_HOST, host.motdfile);
- host.motdfile = XSTRDUP (MTYPE_HOST, argv[0]);
-
- return CMD_SUCCESS;
+ return cmd_banner_motd_file (argv[0]);
}
DEFUN (banner_motd_default,
extern void print_version (const char *);
+extern int cmd_banner_motd_file (const char *);
+
/* struct host global, ick */
extern struct host host;
return user;
}
+DEFUN (banner_motd_file,
+ banner_motd_file_cmd,
+ "banner motd file [FILE]",
+ "\n\n\n\n")
+{
+ return cmd_banner_motd_file (argv[0]);
+}
+
DEFUN (username_nopassword,
username_nopassword_cmd,
"username WORD nopassword",
{
userlist = list_new ();
install_element (CONFIG_NODE, &username_nopassword_cmd);
+ install_element (CONFIG_NODE, &banner_motd_file_cmd);
}