Conceivably someone might want to run a refresh of the ASN database
from within a script, particularly an unattended script such as a cron
job. Do not generate summary output in that case.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
use warnings;
use Text::CSV_XS; # or trade for Text::CSV
use strict;
+$| = 1;
my $csv = Text::CSV_XS->new({
allow_whitespace => 1,
printf "%5u IPv%s ranges for %s\n",
scalar(@ranges),
($family == AF_INET ? '4' : '6'),
- $asn_number;
+ $asn_number unless ($quiet);
my $file = "$target_dir/".$asn_number.".iv".($family == AF_INET ? '4' : '6');
if (!open($fh, '>', $file)) {