X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=blobdiff_plain;f=scripts%2Fnamed-conf;h=59f3178abf56fca7f2691826e0e9a9f89b37725a;hp=50b7945fb67965fa406df33cd5622322799c4198;hb=refs%2Fheads%2Fbranch-2001-05-11-withlockex-old;hpb=6570759829a7b59f425d9a5f47bc55b7ec303231 diff --git a/scripts/named-conf b/scripts/named-conf index 50b7945..59f3178 100755 --- a/scripts/named-conf +++ b/scripts/named-conf @@ -1,4 +1,19 @@ #!/usr/bin/perl -w +# This is chiark-named-conf, which is Copyright 2002 Ian Jackson. +# +# chiark-named-conf and its manpage are free software; you can +# redistribute it and/or modify them under the terms of the GNU +# General Public License as published by the Free Software Foundation; +# either version 2, or (at your option) any later version. +# +# chiark-named-conf and its manpage are distributed in the hope that +# it will be useful, but WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. use strict; use IO::File; @@ -6,6 +21,50 @@ use Data::Dumper; use POSIX; use Fcntl qw(:DEFAULT :flock); +# bastard Perl wants me to do this now ! +sub loarg(); +sub soarg(); +sub usageerr ($); +sub cfg_fail ($); +sub read_config ($); +sub qualify ($); +sub bad_modifiers ($); +sub zone_conf ($$$$$@); +sub set_output($); +sub progress ($$); +sub verbose ($); +sub process_zones (@); +sub zone_warning ($$); +sub zone_warnmore ($); +sub zone_check_full (); +sub zone_reset(); +sub zone_investigate(); +sub zone_check_nsrrset ($$$$); +sub zone_ns_name ($$); +sub zone_server_queue ($$$$$); +sub zone_server_addr ($$$$$); +sub zone_check_soa ($$$$); +sub zone_consistency(); +sub zone_servers_ok (); +sub zone_consistency_set ($%); +sub zone_check_local (); +sub zone_servers_simplefind (); +sub zone_server_simple ($$$); +sub zone_style ($$); +sub mail_zone_before (); +sub mail_zone_after (); +sub pmail ($); +sub ptime ($); +sub mail_zone_mail (); +sub zone_output (); +sub output_files (); +sub debug_dump ($); +sub debug_trace ($); +sub has_suffix_of ($$); +sub lookup ($$$$); +sub dig (&$$$); +sub domain_canon ($$); + use vars qw($quis $stdout_fh $stderr_fh $mode $doall $domail $etcfile $where @@ -28,7 +87,7 @@ $admin=''; $mail_state_dir=''; $mail_max_warnfreq= 50; $repeat= 0; $domail= ''; $modifiers= ''; -$group2modcmd{'foreign'}= '*$!@?'; +$group2modcmd{'foreign'}= '$!*@?'; $group2used{'foreign'}= 1; ($progress_fh= $stdout_fh= new_from_fd IO::Handle(1,'w') and @@ -145,7 +204,7 @@ $install= $mode =~ m/^[yf]/; read_config($etcfile); debug_dump('@zone_cfg_list %zone_cfg'); -process_zones($mode && !$domail ? @zone_cfg_list : @ARGV); +process_zones(!@ARGV ? @zone_cfg_list : @ARGV); debug_dump('%output_contents'); output_files() if $install; @@ -780,7 +839,14 @@ sub mail_zone_after () { } else { mail_zone_mail(); } - } + } else { + printf " %-40s %d warns. OK %s Fail %s\n", + $zone, + defined $zone_warnings{$zone} ? $zone_warnings{$zone} : 0, + join(',', map { $_ - $m_time } @m_ok), + join(',', map { $_ - $m_time } @m_fail) + or die "$quis: checking progress report: $!\n"; + } @m_fail= @m_ok= ('','') if $domail =~ m/^final/; @@ -890,8 +956,9 @@ END $r == $c or die "$quis: waitpid sendmail ($c): $r $!"; $? and warn "$quis: sendmail failed: $?\n"; - printf " %-40s %s\n", $zone, $zone_to or - die "$quis: write mailing report: $!\n"; + printf " %-40s %s\n", $zone, + length $zone_to ? $zone_to : 'reporting to admin' + or die "$quis: write mailing report: $!\n"; } #-------------------- outputting