Ver código fonte

Fix a silly logic error in my dns script

First real bug in it for years, its served me well.
master
Mitch Tishmack 9 anos atrás
pai
commit
bf7187eac4
1 arquivos alterados com 3 adições e 1 exclusões
  1. +3
    -1
      bin.org

+ 3
- 1
bin.org Ver arquivo

@@ -186,9 +186,11 @@ my $lookup = $input;

if ( $lookup =~ /\d+[.]\d+[.]\d+[.]\d+/smx ) {
$lookup = ( gethostbyaddr inet_aton($lookup), AF_INET )[0];
die "Error: Unable to reverse lookup ip $input.\n" if ( $lookup eq q{} );
}

die "Error: Unable to reverse lookup ip $input.\n"
if ( !(defined $lookup) or $lookup eq q{} );

my $ipv4 = gethostbyname $lookup;

die "Error: $lookup doesn't have any known ip addresses\n"


Carregando…
Cancelar
Salvar