.BI /etc/quagga/Quagga.conf
The default location of the integrated Quagga routing engine config file
if integrated config file is in use (not default).
+.TP
+.BI ${HOME}/.history_quagga
+Location of history of commands entered via cli
.SH WARNING
This man page is intended to be a quick reference for command line
options. The definitive document is the Info file \fBQuagga\fR.
int echo_command = 0;
int no_error = 0;
int markfile = 0;
+ char *homedir = NULL;
/* Preserve name of myself. */
progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
exit(0);
}
+ /*
+ * Setup history file for use by both -c and regular input
+ * If we can't find the home directory, then don't store
+ * the history information
+ */
+ homedir = vtysh_get_home ();
+ if (homedir)
+ {
+ snprintf(history_file, sizeof(history_file), "%s/.history_quagga", homedir);
+ if (read_history (history_file) != 0)
+ {
+ int fp;
+
+ fp = open (history_file, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ if (fp)
+ close (fp);
+
+ read_history (history_file);
+ }
+ }
+
/* If eval mode. */
if (cmd)
{
{
*eol = '\0';
+ add_history (cmd->line);
+ append_history (1, history_file);
+
if (echo_command)
printf("%s%s\n", vtysh_prompt(), cmd->line);
cmd->line = eol+1;
}
+ add_history (cmd->line);
+ append_history (1, history_file);
+
if (echo_command)
printf("%s%s\n", vtysh_prompt(), cmd->line);
XFREE(0, cr);
}
}
+
+ history_truncate_file(history_file,1000);
exit (0);
}
sigsetjmp (jmpbuf, 1);
jmpflag = 1;
- snprintf(history_file, sizeof(history_file), "%s/.history_quagga", getenv("HOME"));
- read_history(history_file);
/* Main command loop. */
while (vtysh_rl_gets ())
vtysh_execute (line_read);