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

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

revision 481 by dpavlin, Sun Aug 30 10:38:13 2009 UTC revision 482 by dpavlin, Sat Jan 23 18:31:14 2010 UTC
# Line 7  use Net::OpenSSH; Line 7  use Net::OpenSSH;
7  use English;  use English;
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9  use client;  use client;
10  use CouchDB;  use store;
11    
12  my $id = 3;  my $id = 3;
13  my $id_rsa = '/root/.ssh/id_rsa';  my $id_rsa = '/root/.ssh/id_rsa';
# Line 70  sub shell { Line 70  sub shell {
70                  my ($out,$err) = $ssh->capture2( $command ) or die "$command ", $ssh->error;                  my ($out,$err) = $ssh->capture2( $command ) or die "$command ", $ssh->error;
71                  warn "$out\n$err";                  warn "$out\n$err";
72    
73                  CouchDB::audit( $ip, $command, { ip => $ip, command => $command, out => $out, err => $err } );                  store::audit( $ip, $command, { ip => $ip, command => $command, out => $out, err => $err } );
74    
75                  $html .= qq|<tt style="color: grey">root\@$ip:# <b>$command</b></tt><pre>$out</pre>|;                  $html .= qq|<tt style="color: grey">root\@$ip:# <b>$command</b></tt><pre>$out</pre>|;
76                  $html .= qq|<pre style="color: red">$err</pre>| if $err;                  $html .= qq|<pre style="color: red">$err</pre>| if $err;

Legend:
Removed from v.481  
changed lines
  Added in v.482

  ViewVC Help
Powered by ViewVC 1.1.26