diff options
Diffstat (limited to 'ipchanges.pl')
-rw-r--r-- | ipchanges.pl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ipchanges.pl b/ipchanges.pl new file mode 100644 index 0000000..5b3211a --- /dev/null +++ b/ipchanges.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl + +my $file = "/home/lookshe/myips.txt"; + +open(FILE, $file) || die("unable to open $file!"); +my @lines = <FILE>; +close(FILE); + +for ($i = 1; $i <= $#lines-2; $i+=2) +{ + my $ip = $lines[$i]; + chomp($ip); + my $nextip = $lines[$i+2]; + chomp($nextip); + if ($ip !~ m/^$nextip$/) + { + my $time = $lines[$i+1]; + chomp($time); + print "$time: $ip -> $nextip\n"; + } +} |