48 |
print "RENEW $mac $ip\n"; |
print "RENEW $mac $ip\n"; |
49 |
return $ip; |
return $ip; |
50 |
} else { |
} else { |
51 |
$ip = client::next_ip; |
$ip = client::next_ip( $mac ); |
52 |
print "NEW $mac $ip\n"; |
print "NEW $mac $ip\n"; |
|
symlink "$conf/ip/$ip", "$conf/mac/$mac"; |
|
53 |
} |
} |
54 |
|
|
|
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"; |
|
|
|
|
55 |
return $ip; |
return $ip; |
56 |
} |
} |
57 |
|
|