/[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 216 by dpavlin, Wed Aug 12 23:59:01 2009 UTC revision 217 by dpavlin, Thu Aug 13 13:32:19 2009 UTC
# Line 44  sub conf { Line 44  sub conf {
44          return $value;          return $value;
45  }  }
46    
 sub mac {  
         my $ip = shift;  
         my $mac = client::conf( $ip, 'mac' ) || return '';  
         format::mac( $ip, @_ );  
 }  
   
47  sub next_ip($) {  sub next_ip($) {
48          my $mac = shift;          my $mac = shift;
49    
# Line 70  sub next_ip($) { Line 64  sub next_ip($) {
64    
65          mkdir ip_path($ip);          mkdir ip_path($ip);
66    
67          symlink ip_path($ip), mac_path($mac);          my $mac_path = mac_path($mac);
68            unlink $mac_path if -e $mac_path;       # XXX audit?
69            symlink ip_path($ip), $mac_path;
70          write_file ip_path($ip,'mac'), $mac;          write_file ip_path($ip,'mac'), $mac;
71    
72          return $ip;          return $ip;

Legend:
Removed from v.216  
changed lines
  Added in v.217

  ViewVC Help
Powered by ViewVC 1.1.26