X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fwww_shellcommands.pm;h=bef2e9470d99a9bda8fe9467644fa7a675c7d941;hp=91b294eabb237a45c341848f51715db0c25cdcd7;hb=1ad547a47f16b4230762e752fbe48d460ed997e1;hpb=f4723862a096bd9eecd47727c9a99ebedc131ac9 diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm index 91b294eab..bef2e9470 100644 --- a/FS/FS/part_export/www_shellcommands.pm +++ b/FS/FS/part_export/www_shellcommands.pm @@ -177,14 +177,15 @@ sub shellcommands_queue { } 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 -#} - +1;