/[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 207 by dpavlin, Tue Aug 11 15:55:26 2009 UTC revision 208 by dpavlin, Wed Aug 12 23:59:01 2009 UTC
# Line 7  use autodie; Line 7  use autodie;
7  use server;  use server;
8  use File::Slurp;  use File::Slurp;
9  use Net::Ping;  use Net::Ping;
10    use format;
11    
12  sub mac_path { $server::conf . '/mac/' . $_[0] }  sub mac_path { $server::conf . '/mac/' . $_[0] }
13  sub  ip_path { $server::conf . '/ip/'  . join('/', @_) }  sub  ip_path { $server::conf . '/ip/'  . join('/', @_) }
# Line 44  sub conf { Line 45  sub conf {
45  }  }
46    
47  sub mac {  sub mac {
48          my ( $ip, $op ) = @_;          my $ip = shift;
49          $op ||= 'html';          my $mac = client::conf( $ip, 'mac' ) || return '';
50          my $mac = client::conf( $ip, 'mac' );          format::mac( $ip, @_ );
         return '' unless $mac;  
         $mac =~ s{(..)}{$1:}g;  
         $mac =~ s{:$}{};  
         $mac = qq|<tt>$mac</tt>| if (caller(1))[3] =~ m{^httpd} && $op ne 'clean';  
         return uc($mac);  
51  }  }
52    
53  sub next_ip($) {  sub next_ip($) {

Legend:
Removed from v.207  
changed lines
  Added in v.208

  ViewVC Help
Powered by ViewVC 1.1.26