/[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 153 - (show annotations)
Wed Aug 5 23:22:17 2009 UTC (14 years, 7 months ago) by dpavlin
File size: 722 byte(s)
added client hostname and deploy of configuration over web
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 $domain_name = 'pxelator.lan';
13
14 our $base_dir = '/srv/pxelator';
15
16 use Module::Refresh qw//;
17 sub refresh { Module::Refresh->refresh };
18
19 mkdir $_ foreach grep { ! -e $_ } map { "$base_dir/conf/$server::ip/$_" } ( 'ip', 'mac', 'hostname', 'deploy' );
20
21 use File::Slurp;
22 sub shared {
23 my ($name, $value) = @_;
24
25 my $path ="$base_dir/conf/$server::ip/$name";
26 if ( defined $value ) {
27 write_file $path, $value;
28 warn "update $path = $value";
29 } else {
30 $value = read_file $path if -e $path;
31 }
32 return $value;
33 }
34
35 sub debug { shared('debug', @_) || 0 }
36
37 warn "loaded";
38
39 1;

  ViewVC Help
Powered by ViewVC 1.1.26