summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-03-10 17:04:26 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-03-10 17:04:26 +0100
commitb7fec238bd094d70df001c069cb9ac11056f907c (patch)
treeee699df73ccd6cccaf58fb32c3eeafc5af9913bf /src/fastd.c
parente1b955d0fa9e6d1280d9e27cb7545e5d582dea28 (diff)
downloadfastd-b7fec238bd094d70df001c069cb9ac11056f907c.tar
fastd-b7fec238bd094d70df001c069cb9ac11056f907c.zip
Add --verify-config option
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/fastd.c b/src/fastd.c
index 532c8be..9115bbf 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -896,10 +896,12 @@ int main(int argc, char *argv[]) {
init_signals(&ctx);
- if (conf.daemon)
- status_fd = daemonize(&ctx);
+ if (!conf.verify_config) {
+ if (conf.daemon)
+ status_fd = daemonize(&ctx);
- init_log(&ctx);
+ init_log(&ctx);
+ }
#ifdef HAVE_LIBSODIUM
sodium_init();
@@ -913,6 +915,9 @@ int main(int argc, char *argv[]) {
fastd_config_check(&ctx, &conf);
+ if (conf.verify_config)
+ exit(0);
+
update_time(&ctx);
ctx.next_keepalives = fastd_in_seconds(&ctx, conf.keepalive_interval);