--- lib/PXElator/dhcpd.pm 2009/08/07 14:08:21 177 +++ lib/PXElator/dhcpd.pm 2009/08/11 15:55:26 200 @@ -44,26 +44,14 @@ my $ip; - if ( -e "$conf/mac/$mac" ) { - $ip = read_file "$conf/mac/$mac"; + if ( $ip = client::ip_from_mac( $mac ) ) { print "RENEW $mac $ip\n"; return $ip; } else { - $ip = client::next_ip; + $ip = client::next_ip( $mac ); print "NEW $mac $ip\n"; - write_file "$conf/mac/$mac", $ip; } - my $ip_path = "$conf/ip/$ip"; - mkdir $ip_path unless -e $ip_path; - - if ( -l "$ip_path/mac" && readlink "$ip_path/mac" ne "$conf/mac/$mac" ) { - warn "$mac IP changed from ", readlink "$ip_path/mac", " to $ip"; - unlink "$ip_path/mac"; - }; - - symlink "$conf/mac/$mac", "$ip_path/mac"; - return $ip; }