summaryrefslogtreecommitdiff
path: root/FS/FS/svc_acct.pm
diff options
context:
space:
mode:
authorivan <ivan>2001-09-19 19:39:24 +0000
committerivan <ivan>2001-09-19 19:39:24 +0000
commit14f855379a4022a283e21f3d6b52ebd4ac0b1a22 (patch)
tree51b4833cd832f402b13e276f7d61033dfe2ed09a /FS/FS/svc_acct.pm
parentbde088d345e93b12c88072c4a3fb5f021ffc9157 (diff)
hopefully report some sort of ssh error
Diffstat (limited to 'FS/FS/svc_acct.pm')
-rw-r--r--FS/FS/svc_acct.pm24
1 files changed, 21 insertions, 3 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 4b902ff..8e3c729 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -868,15 +868,33 @@ sub email {
=cut
sub ssh {
- my @args = @_;
- &Net::SSH::ssh(@args,">>/usr/local/etc/freeside/sshoutput 2>&1");
+ my ( $host, @cmd_and_args ) = @_;
+
+ use IO::File;
+ my $reader = IO::File->new();
+ my $writer = IO::File->new();
+ my $error = IO::file->new();
+
+ &Net::SSH::sshopen3( $host, $reader, $writer, $error, @cmd_and_args) or die $!;
+
+ local $/ = undef;
+ my $output_stream = <$writer>;
+ my $error_stream = <$error>;
+ if ( length $error_stream ) {
+ warn "[FS::svc_acct::ssh] STDERR $error_stream";
+ }
+ if ( length $output_stream ) {
+ warn "[FS::svc_acct::ssh] STDOUT $output_stream";
+ }
+
+# &Net::SSH::ssh(@args,">>/usr/local/etc/freeside/sshoutput 2>&1");
}
=back
=head1 VERSION
-$Id: svc_acct.pm,v 1.43 2001-09-19 19:28:17 ivan Exp $
+$Id: svc_acct.pm,v 1.44 2001-09-19 19:39:24 ivan Exp $
=head1 BUGS