reduced version requirements for some modules; made sync-slave a little more robust?
This commit is contained in:
@ -5,6 +5,8 @@ use warnings;
|
||||
use Martnet::DDNS;
|
||||
use File::Temp qw/tempfile/;
|
||||
|
||||
my $force = shift; # a "force" flag, if the update is big
|
||||
|
||||
my $ddns = Martnet::DDNS->new();
|
||||
|
||||
my @vh = $ddns->get();
|
||||
@ -15,12 +17,17 @@ my @all = parse_slavefile("/etc/bind/martnet.slave.zones.9");
|
||||
my $changecount = 0;
|
||||
foreach my $i (@vh) {
|
||||
unless (contains_zone($i, @all)) {
|
||||
# If we find any differences, we rewrite the file
|
||||
do_rewrite(@vh);
|
||||
last;
|
||||
$changecount++;
|
||||
}
|
||||
}
|
||||
|
||||
die "Cowardly refusing to make a big update automatically"
|
||||
if ($changecount > 10 && !$force);
|
||||
|
||||
if ($changecount) {
|
||||
do_rewrite(@vh);
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
sub parse_slavefile {
|
||||
|
||||
Reference in New Issue
Block a user