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 = 2; |
my $id = 3; |
13 |
my $id_rsa = '/root/.ssh/id_rsa'; |
my $id_rsa = '/root/.ssh/id_rsa'; |
14 |
|
|
15 |
sub copy_id { |
sub copy_id { |
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; |