diff --git a/lib/command.c b/lib/command.c
index 2084160..37767e9 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2794,34 +2794,69 @@
   return cmd_execute_command_real(vline, FILTER_STRICT, vty, cmd);
 }
 
+/**
+ * Parse one line of config, walking up the parse tree attempting to find a match
+ *
+ * @param vty The vty context in which the command should be executed.
+ * @param cmd Pointer where the struct cmd_element* of the match command
+ *            will be stored, if any.  May be set to NULL if this info is
+ *            not needed.
+ * @param use_daemon Boolean to control whether or not we match on CMD_SUCCESS_DAEMON
+ *                   or not.
+ * @return The status of the command that has been executed or an error code
+ *         as to why no command could be executed.
+ */
+int
+command_config_read_one_line (struct vty *vty, struct cmd_element **cmd, int use_daemon)
+{
+  vector vline;
+  int saved_node;
+  int ret;
+
+  vline = cmd_make_strvec (vty->buf);
+
+  /* In case of comment line */
+  if (vline == NULL)
+    return CMD_SUCCESS;
+
+  /* Execute configuration command : this is strict match */
+  ret = cmd_execute_command_strict (vline, vty, cmd);
+
+  saved_node = vty->node;
+
+  while (!(use_daemon && ret == CMD_SUCCESS_DAEMON) &&
+	 ret != CMD_SUCCESS && ret != CMD_WARNING &&
+	 ret != CMD_ERR_NOTHING_TODO && vty->node != CONFIG_NODE) {
+    vty->node = node_parent(vty->node);
+    ret = cmd_execute_command_strict (vline, vty, NULL);
+  }
+
+  // If climbing the tree did not work then ignore the command and
+  // stay at the same node
+  if (!(use_daemon && ret == CMD_SUCCESS_DAEMON) &&
+      ret != CMD_SUCCESS && ret != CMD_WARNING &&
+      ret != CMD_ERR_NOTHING_TODO)
+    {
+      vty->node = saved_node;
+    }
+
+  cmd_free_strvec (vline);
+
+  return ret;
+}
+
 /* Configration make from file. */
 int
 config_from_file (struct vty *vty, FILE *fp, unsigned int *line_num)
 {
   int ret;
   *line_num = 0;
-  vector vline;
 
   while (fgets (vty->buf, VTY_BUFSIZ, fp))
     {
       ++(*line_num);
-      vline = cmd_make_strvec (vty->buf);
 
-      /* In case of comment line */
-      if (vline == NULL)
-	continue;
-      /* Execute configuration command : this is strict match */
-      ret = cmd_execute_command_strict (vline, vty, NULL);
-
-      /* Try again with setting node to CONFIG_NODE */
-      while (ret != CMD_SUCCESS && ret != CMD_WARNING
-	     && ret != CMD_ERR_NOTHING_TODO && vty->node != CONFIG_NODE)
-	{
-	  vty->node = node_parent(vty->node);
-	  ret = cmd_execute_command_strict (vline, vty, NULL);
-	}
-
-      cmd_free_strvec (vline);
+      ret = command_config_read_one_line (vty, NULL, 0);
 
       if (ret != CMD_SUCCESS && ret != CMD_WARNING
 	  && ret != CMD_ERR_NOTHING_TODO)
diff --git a/lib/command.h b/lib/command.h
index bb0122f..6030069 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -527,6 +527,7 @@
 extern vector cmd_describe_command (vector, struct vty *, int *status);
 extern char **cmd_complete_command (vector, struct vty *, int *status);
 extern const char *cmd_prompt (enum node_type);
+extern int command_config_read_one_line (struct vty *vty, struct cmd_element **, int use_config_node);
 extern int config_from_file (struct vty *, FILE *, unsigned int *line_num);
 extern enum node_type node_parent (enum node_type);
 extern int cmd_execute_command (vector, struct vty *, struct cmd_element **, int);
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 783c383..b55c671 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -251,14 +251,6 @@
     }
 }
 
-static void
-vtysh_exit_ripd_only (void)
-{
-  if (ripd_client)
-    vtysh_client_execute (ripd_client, "exit", stdout);
-}
-
-
 void
 vtysh_pager_init (void)
 {
@@ -457,53 +449,11 @@
 vtysh_config_from_file (struct vty *vty, FILE *fp)
 {
   int ret;
-  vector vline;
   struct cmd_element *cmd;
 
   while (fgets (vty->buf, VTY_BUFSIZ, fp))
     {
-      if (vty->buf[0] == '!' || vty->buf[1] == '#')
-	continue;
-
-      vline = cmd_make_strvec (vty->buf);
-
-      /* In case of comment line. */
-      if (vline == NULL)
-	continue;
-
-      /* Execute configuration command : this is strict match. */
-      ret = cmd_execute_command_strict (vline, vty, &cmd);
-
-      /* Try again with setting node to CONFIG_NODE. */
-      if (ret != CMD_SUCCESS 
-	  && ret != CMD_SUCCESS_DAEMON
-	  && ret != CMD_WARNING)
-	{
-	  if (vty->node == KEYCHAIN_KEY_NODE)
-	    {
-	      vty->node = KEYCHAIN_NODE;
-	      vtysh_exit_ripd_only ();
-	      ret = cmd_execute_command_strict (vline, vty, &cmd);
-
-	      if (ret != CMD_SUCCESS 
-		  && ret != CMD_SUCCESS_DAEMON 
-		  && ret != CMD_WARNING)
-		{
-		  vtysh_exit_ripd_only ();
-		  vty->node = CONFIG_NODE;
-		  ret = cmd_execute_command_strict (vline, vty, &cmd);
-		}
-	    }
-	  else
-	    {
-	      vtysh_execute ("end");
-	      vtysh_execute ("configure terminal");
-	      vty->node = CONFIG_NODE;
-	      ret = cmd_execute_command_strict (vline, vty, &cmd);
-	    }
-	}	  
-
-      cmd_free_strvec (vline);
+      ret = command_config_read_one_line (vty, &cmd, 1);
 
       switch (ret)
 	{
