hush debug output
[pxelator] / lib / PXElator / server.pm
index 5b66227..ec904e5 100644 (file)
@@ -3,26 +3,28 @@ package server;
 use warnings;
 use strict;
 
+our $base_dir = '/srv/pxelator';
 
-our $ip      = '172.16.10.1';
-our $netmask = '255.255.255.0';
-our $bcast   = '172.16.10.255';
-
-if ( my $dev = $ENV{DEV} ) {
-       my $ifconfig = `ifconfig $dev`;
-       ( $ip, $bcast, $netmask ) = ( $1, $2, $3 ) if $ifconfig =~ m{inet addr:(\S+)\s+Bcast:(\S+)\s+Mask:(\S+)}s;
-       warn "DEV $dev $ip $bcast $netmask";
-}
+use ties;
 
-our ( $ip_from, $ip_to ) = ( 10, 100 );
+tie our $ip,      'ties', 'server_ip' => '172.16.10.1';
+tie our $netmask, 'ties', 'netmask'   => '255.255.255.0';
+tie our $bcast,   'ties', 'bcast'     => '172.16.10.254';
+tie our $ip_from, 'ties', 'ip_from'   => 10;
+tie our $ip_to,   'ties', 'ip_to'     => 100;
+tie our $domain,  'ties', 'domain'    => 'pxelator.lan';
+tie our $new_clients, 'ties', 'new_clients' => $ip_to - $ip_from;
 
-our $domain_name = 'pxelator.lan';
+warn "DEV $ip $bcast $netmask";
 
-our $base_dir = '/srv/pxelator';
-
-our $conf = "$base_dir/conf/$ip";
+our $conf = "$base_dir/conf";
 mkdir $conf unless -e $conf;
 
+sub conf {
+       warn "## conf $conf";
+       $conf;
+}
+
 use Module::Refresh qw//;
 sub refresh {
        Module::Refresh->refresh;