projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
79136b6
)
change www_shellcommands to use Net::OpenSSH, RT8115
author
levinse
<levinse>
Fri, 21 Jan 2011 05:55:45 +0000
(
05:55
+0000)
committer
levinse
<levinse>
Fri, 21 Jan 2011 05:55:45 +0000
(
05:55
+0000)
FS/FS/part_export/www_shellcommands.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_export/www_shellcommands.pm
b/FS/FS/part_export/www_shellcommands.pm
index
91b294e
..
d6116ab
100644
(file)
--- a/
FS/FS/part_export/www_shellcommands.pm
+++ b/
FS/FS/part_export/www_shellcommands.pm
@@
-177,14
+177,14
@@
sub shellcommands_queue {
}
sub ssh_cmd { #subroutine, not method
}
sub ssh_cmd { #subroutine, not method
- use Net::SSH '0.08';
- &Net::SSH::ssh_cmd( { @_ } );
+ use Net::OpenSSH;
+ my $opt = { @_ };
+ my $ssh = Net::OpenSSH->new($opt->{'user'}.'@'.$opt->{'host'});
+ die "Couldn't establish SSH connection: ". $ssh->error if $ssh->error;
+ my ($output, $errput) = $ssh->capture2($opt->{'command'});
+ die "Error running SSH command: ". $ssh->error if $ssh->error;
+ die $errput if $errput;
+ die $output if $output;
+ '';
}
}
-#sub shellcommands_insert { #subroutine, not method
-#}
-#sub shellcommands_replace { #subroutine, not method
-#}
-#sub shellcommands_delete { #subroutine, not method
-#}
-