소스 검색

Fix a silly logic error in my dns script

First real bug in it for years, its served me well.
master
Mitch Tishmack 9 년 전
부모
커밋
bf7187eac4
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. +3
    -1
      bin.org

+ 3
- 1
bin.org 파일 보기

@@ -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"


불러오는 중...
취소
저장