/[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

Annotation of /lib/PXElator/server.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 138 - (hide annotations)
Tue Aug 4 15:25:09 2009 UTC (14 years, 8 months ago) by dpavlin
File size: 540 byte(s)
quite huge refactoring

- config is now place to define client configuration
- upstream provide mirroring
- pxelinux creates per-client specific configurations
- various tweaks and cleanups

1 dpavlin 42 package server;
2    
3 dpavlin 67 use warnings;
4     use strict;
5    
6 dpavlin 118
7 dpavlin 57 our $ip = '172.16.10.1';
8     our $netmask = '255.255.255.0';
9 dpavlin 42
10 dpavlin 45 our ( $ip_from, $ip_to ) = ( 10, 100 );
11    
12 dpavlin 131 our $base_dir = '/srv/pxelator';
13 dpavlin 47
14 dpavlin 138 use Module::Refresh qw//;
15     sub refresh { Module::Refresh->refresh };
16 dpavlin 74
17 dpavlin 138 use File::Slurp;
18     sub shared {
19     my ($name, $value) = @_;
20 dpavlin 67
21 dpavlin 138 my $path ="$base_dir/conf/$server::ip/$name";
22     if ( defined $value ) {
23     write_file $path, $value;
24     } else {
25     $value = read_file $path if -e $path;
26     }
27     return $value;
28     }
29    
30     sub debug { shared('debug', @_) || 0 }
31    
32 dpavlin 45 warn "loaded";
33 dpavlin 134
34     1;

  ViewVC Help
Powered by ViewVC 1.1.26