--- lib/PXElator/server.pm 2009/08/06 15:15:53 156 +++ lib/PXElator/server.pm 2009/08/11 12:39:05 198 @@ -6,6 +6,13 @@ 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"; +} our ( $ip_from, $ip_to ) = ( 10, 100 ); @@ -14,6 +21,7 @@ our $base_dir = '/srv/pxelator'; our $conf = "$base_dir/conf/$ip"; +mkdir $conf unless -e $conf; use Module::Refresh qw//; sub refresh { Module::Refresh->refresh };