]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Implement option to exit after config file parsing.
authorOndrej Zajicek <santiago@crfreenet.org>
Thu, 19 Nov 2009 10:44:17 +0000 (11:44 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Thu, 19 Nov 2009 10:44:17 +0000 (11:44 +0100)
doc/bird.sgml
sysdep/unix/main.c

index db9a747430e87aabe1c8afc5dc7c7be8b450396b..4b72ac6175b084a986b08f21d7fbc78daaf44869 100644 (file)
@@ -129,7 +129,10 @@ options. The most important ones are:
        enable debug messages and run bird in foreground.
 
        <tag>-D <m/filename of debug log/</tag>
-       log debugging information to given file instead of stderr
+       log debugging information to given file instead of stderr.
+
+       <tag>-p</tag>
+       just parse the config file and exit.
 
        <tag>-s <m/name of communication socket/</tag>
        use given filename for a  socket for communications with the client, default is <it/prefix/<file>/var/run/bird.ctl</file>.
index 5e4aa97a74e0f57d257ac8027aaa5deff4bee1f9..533754ea3ea02622d2e1089213397aadf9ca45c6 100644 (file)
@@ -365,7 +365,7 @@ signal_init(void)
  *     Parsing of command-line arguments
  */
 
-static char *opt_list = "c:dD:s:";
+static char *opt_list = "c:dD:ps:";
 
 static void
 usage(void)
@@ -374,6 +374,8 @@ usage(void)
   exit(1);
 }
 
+int parse_and_exit;
+
 static void
 parse_args(int argc, char **argv)
 {
@@ -402,6 +404,9 @@ parse_args(int argc, char **argv)
        log_init_debug(optarg);
        debug_flag |= 2;
        break;
+      case 'p':
+       parse_and_exit = 1;
+       break;
       case 's':
        path_control_socket = optarg;
        break;
@@ -444,6 +449,9 @@ main(int argc, char **argv)
 
   read_config();
 
+  if (parse_and_exit)
+    exit(0);
+
   if (!debug_flag)
     {
       pid_t pid = fork();