--- lib/PXElator/server.pm 2009/08/05 13:25:19 148 +++ lib/PXElator/server.pm 2009/08/06 18:09:17 160 @@ -6,6 +6,7 @@ our $ip = '172.16.10.1'; our $netmask = '255.255.255.0'; +our $bcast = '172.16.10.255'; our ( $ip_from, $ip_to ) = ( 10, 100 ); @@ -13,16 +14,22 @@ our $base_dir = '/srv/pxelator'; +our $conf = "$base_dir/conf/$ip"; + use Module::Refresh qw//; sub refresh { Module::Refresh->refresh }; + +mkdir $_ foreach grep { ! -d $_ } map { "$conf/$_" } ( 'ip', 'mac' ); + use File::Slurp; sub shared { my ($name, $value) = @_; - my $path ="$base_dir/conf/$server::ip/$name"; + my $path ="$conf/$name"; if ( defined $value ) { write_file $path, $value; + warn "update $path = $value"; } else { $value = read_file $path if -e $path; }