summaryrefslogtreecommitdiff
path: root/vtysh/vtysh_main.c
diff options
context:
space:
mode:
authorMartin Winter <mwinter@opensourcerouting.org>2017-01-26 00:43:58 +0700
committerMartin Winter <mwinter@opensourcerouting.org>2017-01-26 00:43:58 +0700
commit87d79a9f79015421d8bf7cd07f8486a2bae15ef2 (patch)
tree21a28657da335fdf192be45364d50be0ef4f43c4 /vtysh/vtysh_main.c
parent7fa382d1d0f4c34dd7f8bf161666d04b6f608898 (diff)
vtysh: Add vty_socket cli option to override the compiled-in location for the VTY daemon sockets
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Diffstat (limited to 'vtysh/vtysh_main.c')
-rw-r--r--vtysh/vtysh_main.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index 6b33fca39b..956f97321f 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -53,6 +53,9 @@ char history_file[MAXPATHLEN];
/* Flag for indicate executing child command. */
int execute_flag = 0;
+/* VTY Socket prefix */
+char * vty_sock_path = NULL;
+
/* For sigsetjmp() & siglongjmp(). */
static sigjmp_buf jmpbuf;
@@ -144,6 +147,7 @@ usage (int status)
"-f, --inputfile Execute commands from specific file and exit\n" \
"-E, --echo Echo prompt and command in -c mode\n" \
"-C, --dryrun Check configuration for validity and exit\n" \
+ " --vty_socket Override vty socket path\n" \
"-m, --markfile Mark input file with context end\n"
"-w, --writeconfig Write integrated config (Quagga.conf) and exit\n"
"-h, --help Display this help and exit\n\n" \
@@ -156,6 +160,7 @@ usage (int status)
}
/* VTY shell options, we use GNU getopt library. */
+#define OPTION_VTYSOCK 1000
struct option longopts[] =
{
{ "boot", no_argument, NULL, 'b'},
@@ -163,6 +168,7 @@ struct option longopts[] =
{ "eval", required_argument, NULL, 'e'},
{ "command", required_argument, NULL, 'c'},
{ "daemon", required_argument, NULL, 'd'},
+ { "vty_socket", required_argument, NULL, OPTION_VTYSOCK},
{ "inputfile", required_argument, NULL, 'f'},
{ "echo", no_argument, NULL, 'E'},
{ "dryrun", no_argument, NULL, 'C'},
@@ -310,6 +316,9 @@ main (int argc, char **argv, char **env)
tail = cr;
}
break;
+ case OPTION_VTYSOCK:
+ vty_sock_path = optarg;
+ break;
case 'd':
daemon_name = optarg;
break;