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

Contents of /lib/PXElator/server.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 138 - (show 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 package server;
2
3 use warnings;
4 use strict;
5
6
7 our $ip = '172.16.10.1';
8 our $netmask = '255.255.255.0';
9
10 our ( $ip_from, $ip_to ) = ( 10, 100 );
11
12 our $base_dir = '/srv/pxelator';
13
14 use Module::Refresh qw//;
15 sub refresh { Module::Refresh->refresh };
16
17 use File::Slurp;
18 sub shared {
19 my ($name, $value) = @_;
20
21 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 warn "loaded";
33
34 1;

  ViewVC Help
Powered by ViewVC 1.1.26