]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Allows shorthands for birdc noninteractive commands.
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 25 Nov 2013 01:03:23 +0000 (02:03 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 25 Nov 2013 01:03:23 +0000 (02:03 +0100)
client/client.c

index a9d0096d952f164a0b325e7f33768a6f3f0e9199..b938f344361f70cea21579ba6968b4453cf5f066 100644 (file)
@@ -137,6 +137,21 @@ submit_server_command(char *cmd)
   server_send(cmd);
 }
 
+static inline void
+submit_init_command(char *cmd_raw)
+{
+  char *cmd = cmd_expand(cmd_raw);
+
+  if (!cmd)
+  {
+    cleanup();
+    exit(0);
+  }
+
+  submit_server_command(cmd);
+  free(cmd);
+}
+
 void
 submit_command(char *cmd_raw)
 {
@@ -165,7 +180,7 @@ init_commands(void)
     {
       /* First transition - client received hello from BIRD
         and there is waiting initial command */
-      submit_server_command(init_cmd);
+      submit_init_command(init_cmd);
       init_cmd = NULL;
       return;
     }