summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vtysh/vtysh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index e8968ab896..78e64c1509 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -425,6 +425,12 @@ static int vtysh_execute_func(const char *line, int pager)
cmd_stat = CMD_SUCCESS;
for (i = 0; i < array_size(vtysh_client); i++) {
if (cmd->daemon & vtysh_client[i].flag) {
+ if (vtysh_client[i].fd < 0
+ && (cmd->daemon == vtysh_client[i].flag)) {
+ fprintf(stderr, "%s is not running\n",
+ vtysh_client[i].name);
+ continue;
+ }
cmd_stat = vtysh_client_execute(
&vtysh_client[i], line, fp);
if (cmd_stat != CMD_SUCCESS)