From 10f7bb76da6af91cf361ace76ecf1d45362f0837 Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Thu, 5 Aug 2004 06:42:25 +0000 Subject: add increment serial --- dns_wizard/Bind.pm | 20 ++++++++++++++++++-- 1 file 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", <