freeside/bin bind.export,1.4.4.6,1.4.4.7
ivan
ivan at pouncequick.420.am
Thu Apr 1 18:09:38 PST 2004
Update of /home/cvs/cvsroot/freeside/bin
In directory pouncequick:/tmp/cvs-serv17231/bin
Modified Files:
Tag: FREESIDE_1_4_BRANCH
bind.export
Log Message:
add option to set (r)ndc command
Index: bind.export
===================================================================
RCS file: /home/cvs/cvsroot/freeside/bin/bind.export,v
retrieving revision 1.4.4.6
retrieving revision 1.4.4.7
diff -u -d -r1.4.4.6 -r1.4.4.7
--- bind.export 20 Mar 2003 03:42:51 -0000 1.4.4.6
+++ bind.export 2 Apr 2004 02:09:35 -0000 1.4.4.7
@@ -30,6 +30,11 @@
my $machine = $export->machine;
my $prefix = "$spooldir/$machine";
+ my $bind_rel = $export->option('bind_release');
+ my $ndc_cmd = $export->option('reload')
+ || ( ($bind_rel eq 'BIND9') ? 'rndc' : 'ndc' );
+ my $minttl = $export->option('bind9_minttl');
+
#prevent old domain files from piling up
#rmtree "$prefix" or die "can't rmtree $prefix.db: $!";
@@ -79,6 +84,10 @@
open (DB_MASTER,">$prefix/db.$domain")
or die "can't open $prefix/db.$domain: $!";
+ if ($bind_rel eq 'BIND9') {
+ print DB_MASTER "\$TTL $minttl\n\$ORIGIN $domain.\n";
+ }
+
my @domain_records =
qsearch('domain_record', { 'svcnum' => $svc_domain->svcnum } );
foreach my $domain_record (
@@ -114,7 +123,7 @@
} ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
# warn $rsync->out;
- ssh("root\@$machine", 'ndc reload');
+ ssh("root\@$machine", "$ndc_cmd reload");
}
@@ -125,6 +134,9 @@
my $machine = $sexport->machine;
my $prefix = "$spooldir/$machine";
+ my $bind_rel = $sexport->option('bind_release');
+ my $ndc_cmd = ($bind_rel eq 'BIND9') ? 'rndc' : 'ndc';
+
#prevent old domain files from piling up
#rmtree "$prefix" or die "can't rmtree $prefix.db: $!";
@@ -166,7 +178,7 @@
} ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
# warn $rsync->out;
- ssh("root\@$machine", 'ndc reload');
+ ssh("root\@$machine", "$ndc_cmd reload");
}
close NAMED_CONF;
More information about the freeside-commits
mailing list