Mail-Toaster

 view release on metacpan or  search on metacpan

lib/Mail/Toaster/Utility.pm  view on Meta::CPAN

    );

    my $only  = $p{only};

    my $ifconfig = $self->find_bin( "ifconfig", verbose => 0 );

    my $once = 0;

TRY:
    my @ips = grep {/inet/} `$ifconfig`; chomp @ips;
       @ips = grep {!/inet6/} @ips if $p{exclude_ipv6};
       @ips = grep {!/inet 127\.0\.0/} @ips if $p{exclude_localhost};
       @ips = grep {!/inet (192\.168\.|10\.|172\.16\.|169\.254\.)/} @ips
            if $p{exclude_internals};

    # this keeps us from failing if the box has only internal IPs
    if ( @ips < 1 || $ips[0] eq "" ) {
        $self->audit( "yikes, you really don't have any public IPs?!");
        $p{exclude_internals} = 0;
        $once++;
        goto TRY if ( $once < 2 );



( run in 0.224 second using v1.01-cache-2.11-cpan-87723dcf8b7 )