diff --git a/analyse.pl b/analyse.pl index 99841839..32040e2c 100755 --- a/analyse.pl +++ b/analyse.pl @@ -5,7 +5,7 @@ ## Made by Tab ## ## Started on Tue 09 Oct 2001 01:28:25 AM CEST tab -## Last Update Tue Nov 25 19:00:00 2001 Nico +## Last Update mer 30 jan 2002 19:56:00 CET Nicolas STRANSKY ## ## ## This program is free software; you can redistribute it and/or modify @@ -36,6 +36,7 @@ ## use strict; +use IO::Socket; my $inputfile = "/var/log/net-acct/net-acct.log.0"; my $host = ""; @@ -327,7 +328,8 @@ for (my $ct = 0; $ct < @ARGV; $ct++) } elsif ($ARGV[$ct] eq '-h' || $ARGV[$ct] eq '--host') { if ($ARGV[$ct+1] =~ /[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}/) { $host = $ARGV[$ct+1]; $ct++; } - else { usage(); } + else { $host = inet_ntoa((gethostbyname($ARGV[$ct+1]))[4]); $ct++; } + #else { usage(); } # C'est quand meme chiant de pas pouvoir utiliser les hostnames ! Allez, on implémente :) -- Nico } elsif ($ARGV[$ct] =~ '-n' || $ARGV[$ct] eq '--nombre') { if ($ARGV[$ct+1]) { $nombre_line_affiche = $ARGV[$ct+1]; $ct++; }