/[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 156 by dpavlin, Thu Aug 6 15:15:53 2009 UTC revision 165 by dpavlin, Thu Aug 6 18:51:57 2009 UTC
# Line 28  sub conf { Line 28  sub conf {
28                  write_file $path, $default;                  write_file $path, $default;
29                  warn "default $path = $default";                  warn "default $path = $default";
30                  $value = $default;                  $value = $default;
31          } else {          } elsif ( -e $path ) {
32                  $value = read_file $path if -e $path;                  if ( -l $path ) {
33                            $value = readlink $path;
34                            $value =~ s{.*/([^/]+)$}{$1};
35                    } else {
36                            $value = read_file $path;
37                    }
38          }          }
39          return $value;          return $value;
40  }  }
41    
42    sub mac {
43            my $ip = shift;
44            my $mac = client::conf( $ip, 'mac' );
45            $mac =~ s{(..)}{$1:}g;
46            $mac =~ s{:$}{};
47            $mac = qq|<tt>$mac</tt>| if (caller(1))[3] =~ m{^httpd};
48            return uc($mac);
49    }
50    
51  1;  1;

Legend:
Removed from v.156  
changed lines
  Added in v.165

  ViewVC Help
Powered by ViewVC 1.1.26