/[pxelator]/lib/PXElator/server.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/server.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 138 by dpavlin, Tue Aug 4 15:25:09 2009 UTC revision 156 by dpavlin, Thu Aug 6 15:15:53 2009 UTC
# Line 9  our $netmask = '255.255.255.0'; Line 9  our $netmask = '255.255.255.0';
9    
10  our ( $ip_from, $ip_to ) = ( 10, 100 );  our ( $ip_from, $ip_to ) = ( 10, 100 );
11    
12    our $domain_name = 'pxelator.lan';
13    
14  our $base_dir = '/srv/pxelator';  our $base_dir = '/srv/pxelator';
15    
16    our $conf = "$base_dir/conf/$ip";
17    
18  use Module::Refresh qw//;  use Module::Refresh qw//;
19  sub refresh { Module::Refresh->refresh };  sub refresh { Module::Refresh->refresh };
20    
21    
22    mkdir $_ foreach grep { ! -d $_ } map { "$conf/$_" } ( 'ip', 'mac' );
23    
24  use File::Slurp;  use File::Slurp;
25  sub shared {  sub shared {
26          my ($name, $value) = @_;          my ($name, $value) = @_;
27    
28          my $path ="$base_dir/conf/$server::ip/$name";          my $path ="$conf/$name";
29          if ( defined $value ) {          if ( defined $value ) {
30                  write_file $path, $value;                  write_file $path, $value;
31                    warn "update $path = $value";
32          } else {          } else {
33                  $value = read_file $path if -e $path;                  $value = read_file $path if -e $path;
34          }          }

Legend:
Removed from v.138  
changed lines
  Added in v.156

  ViewVC Help
Powered by ViewVC 1.1.26