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

Diff of /lib/PXElator/server.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 270 by dpavlin, Wed Aug 19 18:10:37 2009 UTC revision 288 by dpavlin, Tue Aug 25 17:09:52 2009 UTC
# Line 8  our $ip      = '172.16.10.1'; Line 8  our $ip      = '172.16.10.1';
8  our $netmask = '255.255.255.0';  our $netmask = '255.255.255.0';
9  our $bcast   = '172.16.10.255';  our $bcast   = '172.16.10.255';
10    
11  if ( my $dev = $ENV{DEV} ) {  sub setup_from_dev {
12          my $ifconfig = `ifconfig $dev`;          my $dev = shift || return;
13            my $ifconfig = `/sbin/ifconfig $dev`;
14          ( $ip, $bcast, $netmask ) = ( $1, $2, $3 ) if $ifconfig =~ m{inet addr:(\S+)\s+Bcast:(\S+)\s+Mask:(\S+)}s;          ( $ip, $bcast, $netmask ) = ( $1, $2, $3 ) if $ifconfig =~ m{inet addr:(\S+)\s+Bcast:(\S+)\s+Mask:(\S+)}s;
15          warn "DEV $dev $ip $bcast $netmask";          warn "DEV $dev $ip $bcast $netmask";
16  }  }
17    
18    setup_from_dev( $ENV{DEV} || 'virtual' );
19    
20  our ( $ip_from, $ip_to ) = ( 10, 100 );  our ( $ip_from, $ip_to ) = ( 10, 100 );
21    
22  our $domain_name = 'pxelator.lan';  our $domain_name = 'pxelator.lan';

Legend:
Removed from v.270  
changed lines
  Added in v.288

  ViewVC Help
Powered by ViewVC 1.1.26