oops again
This commit is contained in:
parent
b14d359c5b
commit
70f9301641
|
@ -24,7 +24,7 @@ my $sighup = 0;
|
|||
|
||||
# Functions included from github:MaffC/maffpl to reduce dependencies on non-CPAN modules
|
||||
sub scp_upload {
|
||||
my $file = shift; my $ssh = Net::SSH2->new();
|
||||
my $file = shift; my $fbn = $file->basename; my $ssh = Net::SSH2->new();
|
||||
try {
|
||||
$ssh->connect($Conf->{upload}->{server},$Conf->{upload}->{port},Timeout => 3);
|
||||
} catch {
|
||||
|
@ -34,7 +34,7 @@ sub scp_upload {
|
|||
$ssh->auth_publickey($Conf->{upload}->{user},$Conf->{upload}->{sshkeypath}.'.pub',$Conf->{upload}->{sshkeypath});
|
||||
logger(2,"SSH connection failed (auth error): $ssh->error") and return 0 unless $ssh->auth_ok;
|
||||
$Conf->{upload}->{remotepath} .= "/" unless $Conf->{upload}->{remotepath} =~ /\/$/;
|
||||
logger(2,"File upload failed: $ssh->error") and return 0 unless $ssh->scp_put("$file",$Conf->{upload}->{remotepath}.$file->basename);
|
||||
logger(2,"File upload failed: $ssh->error") and return 0 unless $ssh->scp_put("$file",$Conf->{upload}->{remotepath}.$fbn);
|
||||
$ssh->disconnect; return 1;
|
||||
}
|
||||
sub timefmt2str {
|
||||
|
|
Loading…
Reference in New Issue