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

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

revision 82 by dpavlin, Fri Jul 31 17:07:39 2009 UTC revision 83 by dpavlin, Fri Jul 31 17:12:52 2009 UTC
# Line 7  use File::Slurp; Line 7  use File::Slurp;
7    
8  use server;  use server;
9    
10    sub ifconfig {
11            my $dev = shift;
12            `/sbin/ifconfig $dev`
13    }
14    
15  sub tap {  sub tap {
16    
17          my $interfaces = read_file '/etc/network/interfaces';          my $interfaces = read_file '/etc/network/interfaces';
# Line 28  sub tap { Line 33  sub tap {
33    
34          }          }
35    
36          `/sbin/ifconfig tap0 2>/dev/null` =~ m{UP} || system "sudo ifup tap0";          ifconfig('tap0') =~ m{UP}               &&      return 'up';
37            system("sudo ifup tap0") == 0   &&      return 'started';
         1;  
38  }  }
39    
40  1;  1;

Legend:
Removed from v.82  
changed lines
  Added in v.83

  ViewVC Help
Powered by ViewVC 1.1.26