dns_add_script
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
dns_add_script [2009/08/17 21:11] – jt | dns_add_script [2009/08/18 21:55] – jt | ||
---|---|---|---|
Line 7: | Line 7: | ||
use IO::File; | use IO::File; | ||
use Text:: | use Text:: | ||
+ | use File::Grep qw( fgrep ); | ||
- | my $repository = "/ | + | |
+ | my $repository = "/ | ||
my $dnsData = " | my $dnsData = " | ||
Line 20: | Line 22: | ||
chomp ($entry); | chomp ($entry); | ||
my ($hostName, $ipAddress) = split(' | my ($hostName, $ipAddress) = split(' | ||
+ | ## if ( !defined($ipAddress) ) {print " | ||
my ($domainName, | my ($domainName, | ||
my $dbZoneFile = checkZoneExist($domainName, | my $dbZoneFile = checkZoneExist($domainName, | ||
Line 69: | Line 72: | ||
my $dbZoneFile = " | my $dbZoneFile = " | ||
my $userName = " | my $userName = " | ||
- | my $soa = "2009081701"; | + | my $soa = "2009081801"; |
if ( -e $repository.$dbZoneFile ){ | if ( -e $repository.$dbZoneFile ){ | ||
Line 76: | Line 79: | ||
else{ | else{ | ||
- | my ($tabs) = tabLength($domainName); | + | my ($tabs) = tabLength($domainName." |
makeZone(" | makeZone(" | ||
} | } | ||
Line 103: | Line 106: | ||
my ($dbZoneFile, | my ($dbZoneFile, | ||
- | + | ||
- | + | ||
- | + | ||
if ( defined($subDomain) && | if ( defined($subDomain) && | ||
- | my ($tabs) = tabLength($subDomain); | + | |
- | open(DBFILE, | + | if ( fgrep {/ |
- | print DBFILE " | + | |
- | close (DBFILE); | + | print " |
+ | } | ||
+ | |||
+ | else { | ||
+ | my ($tabs) = tabLength($subDomain); | ||
+ | open(DBFILE, | ||
+ | print DBFILE " | ||
+ | close (DBFILE); | ||
+ | } | ||
} | } | ||
} | } | ||
Line 118: | Line 127: | ||
my ($word) = @_; | my ($word) = @_; | ||
my $tabs = " | my $tabs = " | ||
- | if (length($tabs) == 0) { | + | if (length($tabs) == 0){ |
- | $tabs = " "; | + | $tabs = "\t"; |
- | + | ||
} | } | ||
- | | + | return $tabs; |
} | } | ||
+ | |||
+ | ########################################################################### | ||
+ | # Help, info and correctional information. | ||
+ | ########################################################################### | ||
+ | sub subUsage { | ||
+ | |||
+ | print " | ||
+ | print " | ||
+ | print " | ||
+ | print "list of zones governed by named-zones.conf. This file will be created and sent, if needed, by dnsPush.\n"; | ||
+ | print "Only use this to add a new zone and make sure you have the correct type (virtual, www or blank).\n\n"; | ||
+ | print " | ||
+ | print " | ||
+ | print " | ||
+ | exit(0); | ||
+ | } | ||
+ | |||
</ | </ |
dns_add_script.txt · Last modified: 2020/08/10 02:35 by 127.0.0.1