X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fcardfortress.pm;h=8c941359770f70540bc0ac022c7722341aa0c3a9;hb=674cb2d9d7105f4cc2871539b2e9f7088cdaa750;hp=68a1aea4e69faccd63bdae30f4fe9f376e95d344;hpb=74183581d97f1c258bc3104b71e1798c9b71d308;p=freeside.git diff --git a/FS/FS/part_export/cardfortress.pm b/FS/FS/part_export/cardfortress.pm index 68a1aea4e..8c9413597 100644 --- a/FS/FS/part_export/cardfortress.pm +++ b/FS/FS/part_export/cardfortress.pm @@ -4,6 +4,7 @@ use strict; use base 'FS::part_export'; use vars qw( %info ); use String::ShellQuote; +use Net::OpenSSH; #tie my %options, 'Tie::IxHash'; #; @@ -21,13 +22,12 @@ sub rebless { shift; } sub _export_insert { my($self, $svc_acct) = (shift, shift); - eval "use Net::OpenSSH;"; - return $@ if $@; open my $def_in, '<', '/dev/null' or die "unable to open /dev/null"; my $ssh = Net::OpenSSH->new( $self->machine, default_stdin_fh => $def_in ); + #capture2 and return STDERR, its probably useful if there's a problem my $private_key = $ssh->capture( { 'stdin_data' => $svc_acct->_password. "\n" }, '/usr/local/bin/merchant_create', map $svc_acct->$_, qw( username finger ) @@ -56,18 +56,16 @@ sub _export_replace { } sub _export_delete { - #my( $self, $svc_x ) = (shift, shift); + my( $self, $svc_acct ) = (shift, shift); #well, we're just going to disable them for now, but there you go - eval "use Net::OpenSSH;"; - return $@ if $@; - open my $def_in, '<', '/dev/null' or die "unable to open /dev/null"; my $ssh = Net::OpenSSH->new( $self->machine, default_stdin_fh => $def_in ); - my $private_key = $ssh->run( + #capture2 and return STDERR, its probably useful if there's a problem + my $unused_output = $ssh->capture( '/usr/local/bin/merchant_disable', map $svc_acct->$_, qw( username ) ); return $ssh->error if $ssh->error;