/[pxelator]/lib/PXElator/client.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/client.pm

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

revision 403 by dpavlin, Tue Sep 8 20:38:26 2009 UTC revision 409 by dpavlin, Wed Sep 9 10:36:00 2009 UTC
# Line 12  use server; Line 12  use server;
12  use format;  use format;
13  use ip;  use ip;
14  use ping;  use ping;
15    use kvm;
16    
17  our $debug = $server::debug;  our $debug = $server::debug;
18    
# Line 84  sub next_ip($) { Line 85  sub next_ip($) {
85          my $mac = shift;          my $mac = shift;
86          $mac = format::mac($mac);          $mac = format::mac($mac);
87    
88          if ( $server::new_clients-- ) {          if ( $server::new_clients > 0 ) {
89                  warn "# clients left: $server::new_clients\n";                  warn "# clients left: ", --$server::new_clients;
90          } else {          } else {
91                  warn "W: no new clients accepted";                  warn "W: no new clients accepted";
92                  return '0.0.0.0';                  return '0.0.0.0';
# Line 165  sub all_ips { Line 166  sub all_ips {
166          map {          map {
167                  my $ip = $_;                  my $ip = $_;
168                  $ip =~ s{^.+/ip/}{};                  $ip =~ s{^.+/ip/}{};
169                    autocreate_params( $ip );
170                  $ip;                  $ip;
171          } glob("$server::conf/ip/*")          } glob("$server::conf/ip/*")
172  }  }
# Line 206  sub rebuild_mac_links { Line 208  sub rebuild_mac_links {
208          }          }
209  }  }
210    
211    sub autocreate_params {
212            my $ip = shift;
213            my $mac = mac_from_ip $ip;
214            if ( $mac =~ m{^AC:DE:48:00:00} && ! defined conf( $ip, 'kvm' ) ) {
215                    conf( $ip, 'kvm', default => kvm::nr_from_mac( $mac ) );
216                    warn "# create kvm for $ip";
217            }
218    }
219    
220  1;  1;

Legend:
Removed from v.403  
changed lines
  Added in v.409

  ViewVC Help
Powered by ViewVC 1.1.26