From 33999b8aecfd24fe77aa336fcd4e98b0de6cb65a Mon Sep 17 00:00:00 2001 From: dms Date: Sat, 6 Jan 2001 12:52:46 +0000 Subject: [PATCH] Removed this file. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@228 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Modules/DNS.pl | 59 ---------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 src/Modules/DNS.pl diff --git a/src/Modules/DNS.pl b/src/Modules/DNS.pl deleted file mode 100644 index fb0d619..0000000 --- a/src/Modules/DNS.pl +++ /dev/null @@ -1,59 +0,0 @@ - -# infobot :: Kevin Lenzo (c) 1997 - -# once again, thanks to Patrick Cole - -#use POSIX; -use Socket; -use strict; - -use vars qw($waitedpid); - -sub REAPER { - $SIG{CHLD} = \&REAPER; # loathe sysV - $waitedpid = wait; -} - -$SIG{CHLD} = \&REAPER; - -sub DNS { - my $in = $_[0]; - my($match, $x, $y, $result); - my $pid; - - if (!defined($pid = fork)) { - return "no luck, $who"; - } elsif ($pid) { - # parent - } else { - # child - if ($in =~ /(\d+\.\d+\.\d+\.\d+)/) { - &status("DNS query by IP address: $in"); - $match = $1; - $y = pack('C4', split(/\./, $match)); - $x = (gethostbyaddr($y, &AF_INET)); - if ($x !~ /^\s*$/) { - $result = $match." is ".$x unless ($x =~ /^\s*$/); - } else { - $result = "I can't seem to find that address in DNS"; - } - } else { - &status("DNS query by name: $in"); - $x = join('.',unpack('C4',(gethostbyname($in))[4])); - if ($x !~ /^\s*$/) { - $result = $in." is ".$x; - } else { - $result = "I can\'t find that machine name"; - } - } - - if ($msgType eq 'public') { - &say($result); - } else { - &msg($who, $result); - } - exit; # bye child - } -} - -1; -- 2.39.5