Parent Directory | Revision Log
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 |