diff options
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/src/config.c b/src/config.c index aad39cc..ff9c9e4 100644 --- a/src/config.c +++ b/src/config.c @@ -23,6 +23,9 @@ static struct grecs_keyword sync_kw[] = { { "zone-conf", NULL, "zone configuration file", grecs_type_string, NULL, offsetof(struct nssync, zone_conf_file) }, + { "zonefile-pattern", + NULL, "Pattern for new zone file names", + grecs_type_string, NULL, offsetof(struct nssync, zone_file_pattern) }, { "soa-query", NULL, "Set query for retrieving SOA records", grecs_type_string, NULL, offsetof(struct nssync, soa_query) }, @@ -128,9 +131,6 @@ static struct grecs_keyword nssync_kw[] = { { "bind-include-path", NULL, "Set include path for BIND configuration", grecs_type_string|GRECS_LIST, &bind_include_path }, - { "zonefile-dir", - NULL, "Directory for new zone files", - grecs_type_string, &bind_zonefile_dir }, { "zonefile-pattern", NULL, "Pattern for new zone file names", grecs_type_string, &zone_file_pattern }, @@ -153,8 +153,8 @@ config_help() { static char docstring[] = N_("Configuration file structure for NSsync.\n"); - grecs_format_docstring(docstring, 0, stdout); - grecs_format_statement_array(nssync_kw, 1, 0, stdout); + grecs_print_docstring(docstring, 0, stdout); + grecs_print_statement_array(nssync_kw, 1, 0, stdout); } void @@ -201,6 +201,26 @@ sql_host_fixup() return 0; } +static int +synclist_fixup() +{ + int err = 0; + struct grecs_list_entry *ep; + + for (ep = synclist->head; ep; ep = ep->next) { + struct nssync *sp = ep->data; + if (!sp->zone_file_pattern) { + if (!zone_file_pattern) { + error("%s: zonefile-pattern not defined", + sp->tag); + err = 1; + } else + sp->zone_file_pattern = zone_file_pattern; + } + } + return err; +} + void config_parse() { @@ -217,6 +237,9 @@ config_parse() error("nothing to do!"); err = 1; } + + if (synclist_fixup()) + err = 1; if (sql_host_fixup()) err = 1; |