18 |
tie our $domain, 'ties', 'domain' => 'pxelator.lan'; |
tie our $domain, 'ties', 'domain' => 'pxelator.lan'; |
19 |
tie our $new_clients, 'ties', 'new_clients' => $ip_to - $ip_from; |
tie our $new_clients, 'ties', 'new_clients' => $ip_to - $ip_from; |
20 |
|
|
21 |
|
if ( my $dev = $ENV{DEV} ) { |
22 |
|
my $ifconfig = `ifconfig $dev`; |
23 |
|
die "can't ifconfig $dev" unless $ifconfig; |
24 |
|
$ip = $1 if $ifconfig =~ m/inet addr:(\S+)/s; |
25 |
|
$netmask = $1 if $ifconfig =~ m/Mask:(\S+)/s; |
26 |
|
$bcast = $1 if $ifconfig =~ m/Bcast:(\S)/s; |
27 |
|
} |
28 |
|
|
29 |
warn "DEV $ip $bcast $netmask"; |
warn "DEV $ip $bcast $netmask"; |
30 |
|
|
31 |
our $conf = "$base_dir/conf"; |
our $conf = "$base_dir/conf"; |
71 |
my $ip = shift; |
my $ip = shift; |
72 |
|
|
73 |
my $server; |
my $server; |
74 |
map { $server->{ $_ } = eval '$server::' . $_ } ( 'ip', 'netmask', 'bcast', 'domain' ); |
map { $server->{ $_ } = eval '$server::' . $_ } ( 'ip', 'netmask', 'bcast', 'domain', 'ip_from', 'ip_to', 'new_clients' ); |
75 |
|
|
76 |
my $server_path = "$server::conf/ip/$ip/server.yaml"; |
my $server_path = "$server::conf/ip/$ip/server.yaml"; |
77 |
$server = YAML::LoadFile $server_path if -e $server_path; |
$server = YAML::LoadFile $server_path if -e $server_path; |