Allows shorthands for birdc noninteractive commands.

This commit is contained in:
Ondrej Zajicek 2013-11-25 02:03:23 +01:00
parent e237b28a4d
commit 8137fe6d45

View file

@ -137,6 +137,21 @@ submit_server_command(char *cmd)
server_send(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 void
submit_command(char *cmd_raw) submit_command(char *cmd_raw)
{ {
@ -165,7 +180,7 @@ init_commands(void)
{ {
/* First transition - client received hello from BIRD /* First transition - client received hello from BIRD
and there is waiting initial command */ and there is waiting initial command */
submit_server_command(init_cmd); submit_init_command(init_cmd);
init_cmd = NULL; init_cmd = NULL;
return; return;
} }