aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-11-25 02:03:23 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2013-11-25 02:03:23 +0100
commit8137fe6d45762844248300de2a030e96042b1975 (patch)
tree1878674112b6e4148596538c181036a1050d616f /client
parente237b28a4d4b17ab50182ac110f28594967e76dc (diff)
downloadbird-8137fe6d45762844248300de2a030e96042b1975.tar.gz
Allows shorthands for birdc noninteractive commands.
Diffstat (limited to 'client')
-rw-r--r--client/client.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/client/client.c b/client/client.c
index a9d0096d..b938f344 100644
--- a/client/client.c
+++ b/client/client.c
@@ -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;
}