Changeset 108 for trunk/klask


Ignore:
Timestamp:
Dec 12, 2011, 2:54:51 PM (12 years ago)
Author:
g7moreau
Message:
  • Fusion of two quite same test into one
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/klask

    r107 r108  
    869869            };
    870870         
    871          if ( $mactimedb{$ip_mac}->{timestamp} - $ip_timestamp > $timestamp_barrier
     871         if (
     872            ( $mactimedb{$ip_mac}->{timestamp} - $ip_timestamp > $timestamp_barrier
     873               or (
     874                  $mactimedb{$ip_mac}->{timestamp} > $ip_timestamp
     875                  and $timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_3month
     876                  )
     877            )
    872878            and (
    873879               not $mactimedb{$ip_mac}->{hostname_fq} =~ m/^float/
     
    879885            }
    880886
    881          elsif ( $ip_timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_barrier
     887         elsif (
     888            ( $ip_timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_barrier
     889               or (
     890                  $ip_timestamp > $mactimedb{$ip_mac}->{timestamp}
     891                  and $timestamp - $ip_timestamp > $timestamp_3month
     892                  )
     893            )
    882894            and (
    883895               not $ip_hostname_fq =~ m/^float/
    884896               or $mactimedb{$ip_mac}->{hostname_fq} =~ m/^float/
    885897               )) {
    886             print "remove ip ".$mactimedb{$ip_mac}->{ip}."\n" if $verbose;
    887             delete $computerdb->{$mactimedb{$ip_mac}->{ip}};
    888             $database_has_changed++;
    889             }
    890 
    891          elsif ( $mactimedb{$ip_mac}->{timestamp} > $ip_timestamp
    892             and $timestamp - $mactimedb{$ip_mac}->{timestamp} > $timestamp_3month
    893             and not $mactimedb{$ip_mac}->{hostname_fq} =~ m/^float/
    894             ) {
    895             print "remove ip $ip\n" if $verbose;
    896             delete $computerdb->{$ip};
    897             $database_has_changed++;
    898             }
    899 
    900          elsif (  $ip_timestamp > $mactimedb{$ip_mac}->{timestamp}
    901             and $timestamp - $ip_timestamp > $timestamp_3month
    902             and not $ip_hostname_fq =~ m/^float/
    903             ) {
    904898            print "remove ip ".$mactimedb{$ip_mac}->{ip}."\n" if $verbose;
    905899            delete $computerdb->{$mactimedb{$ip_mac}->{ip}};
Note: See TracChangeset for help on using the changeset viewer.