summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2004-08-05 06:42:25 +0000
committerAntoine Ginies <aginies@mandriva.com>2004-08-05 06:42:25 +0000
commit10f7bb76da6af91cf361ace76ecf1d45362f0837 (patch)
tree12cbc9ed77ee99a7894adcd14cffa7bfbe41d1a0
parent864b927cc508c1dc7d1fdc130c75e07b81a195a0 (diff)
downloaddrakwizard-10f7bb76da6af91cf361ace76ecf1d45362f0837.tar
drakwizard-10f7bb76da6af91cf361ace76ecf1d45362f0837.tar.gz
drakwizard-10f7bb76da6af91cf361ace76ecf1d45362f0837.tar.bz2
drakwizard-10f7bb76da6af91cf361ace76ecf1d45362f0837.tar.xz
drakwizard-10f7bb76da6af91cf361ace76ecf1d45362f0837.zip
add increment serial
-rw-r--r--dns_wizard/Bind.pm20
1 files changed, 18 insertions, 2 deletions
diff --git a/dns_wizard/Bind.pm b/dns_wizard/Bind.pm
index b77e9887..65c178fc 100644
--- a/dns_wizard/Bind.pm
+++ b/dns_wizard/Bind.pm
@@ -35,7 +35,7 @@ use MDK::Wizard::Wizcommon;
my $wiz = new MDK::Wizard::Wizcommon;
-my $SERIAL = `date +%d%m20%y`;
+my $SERIAL = chomp_(`date +%d%m20%y`);
my $HOSTNAME = $wiz->{net}->network_get("HOSTNAME");
my $interface = 'eth0';
my $IPSERVER = $wiz->{net}->itf_get("IPADDR");
@@ -317,6 +317,21 @@ sub get_spe_ip {
}
}
+sub increment_serial {
+ my ($iprev) = @_;
+ my ($SERIAL) = cat_("$ZONE_DIR/db.$DOMAINNAME.hosts") =~ m/\s+(.*?)\s+;\s+Serial/;
+ $SERIAL = chomp_($SERIAL+1);
+ print "$SERIAL\n";
+ substInFile {
+ s/\s+\d+\s+;\s+Serial/ $SERIAL ; Serial/;
+ } "$ZONE_DIR/db.$DOMAINNAME.hosts";
+
+ substInFile {
+ s/\s+\d+\s+;\s+Serial/ $SERIAL ; Serial/;
+ } "$ZONE_DIR/db.$iprev.hosts";
+}
+
+
sub crea_db_local {
output($WDIR . "/db.localhost", <<EOF);
\$TTL 3D
@@ -470,7 +485,7 @@ sub crea_iprev {
output($WDIR . "/db." . $iprev . ".hosts", <<EOF);
\$TTL 3D
@ IN SOA $SHORTHOSTNAME.$d. $SHORTHOSTNAME.$d. (
- $SERIAL ; serial
+ $SERIAL ; Serial
10800 ; Refresh
3600 ; Retry
604800 ; Expire
@@ -745,6 +760,7 @@ sub do_it_add {
append_to_file("$ZONE_DIR/db.$iprev.hosts",
"$ipend\tIN\tPTR\t$SNAME.$DOMAINNAME.\n");
}
+ increment_serial($iprev);
system("service named reload");
}