Changeset 1667 in ProjectBuilder
- Timestamp:
- Oct 27, 2012, 10:16:23 PM (12 years ago)
- Location:
- projects/casparbuster/devel
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
projects/casparbuster/devel/Makefile.PL
r1485 r1667 22 22 'bin/cb' => '$(INST_MAN1DIR)/cb.$(MAN1EXT)', 23 23 }, 24 MAN3PODS => {25 26 27 24 #MAN3PODS => { 25 #'lib/CasparBuster/Env.pm' => '$(INST_MAN3DIR)/CasparBuster::Env.$(MAN3EXT)', 26 #'lib/CasparBuster/Version.pm' => '$(INST_MAN3DIR)/CasparBuster::Version.$(MAN3EXT)', 27 #}, 28 28 ); 29 29 -
projects/casparbuster/devel/bin/cb
r1664 r1667 84 84 use CasparBuster::Env; 85 85 use CasparBuster::Plugin; 86 use CasparBuster::SSH; 86 87 #use Cwd 'realpath'; 87 88 use Carp qw/confess cluck/; … … 377 378 my $chan; 378 379 379 # deal with content first380 # Create remote connection and copy tar file there381 $ssh2 = Net::SSH2->new();382 $ssh2->debug(1) if ($debug > 2);383 384 380 my $mach = $machine; 385 381 if ((defined $cb->{'commondir'}) && (defined $cb->{'commondir'}->{$machine})) { … … 387 383 $mach = $cb->{'websrv'}->{$machine}; 388 384 } 389 $ssh2->connect($mach); 390 my $hdir = (getpwnam(getpwuid($<)))[7]; 391 if ($ssh2->auth_publickey($remote,"$hdir/.ssh/id_dsa.pub","$hdir/.ssh/id_dsa")) { 392 $chan = $ssh2->channel(); 393 $chan->exec("mkdir -p $ENV{'PBTMP'}"); 394 $chan->close; 395 396 $ssh2->scp_put($tarfile,$tarfile); 397 pb_log(0,"INFO: Created $ENV{'PBTMP'} on $remote\@$mach and copying content\n"); 398 } else { 399 pb_log(0,"ERROR: Unable to authenticate to $remote\@$mach\n"); 400 return; 401 } 385 386 $ssh2 = cb_ssh_init($remote,$machine,$debug); 387 388 $ssh2->scp_put($tarfile,$tarfile); 389 pb_log(0,"INFO: Copying content under $ENV{'PBTMP'} on $remote\@$mach\n"); 402 390 403 391 my $path = "/"; … … 408 396 } 409 397 $chan = $ssh2->channel(); 410 $chan->shell(); 398 confess "Unable to launch remote shell through Net:SSH2 ($remote\@$mach)" if (not $chan->shell()); 399 411 400 if (not $debug) { 412 401 print $chan "sudo tar -C $path -x -f $tarfile $tbextract\n"; … … 453 442 } 454 443 $chan->close(); 455 $ssh2->disconnect(); 444 445 cb_ssh_close($ssh2); 456 446 457 447 chdir("/");
Note:
See TracChangeset
for help on using the changeset viewer.