Ferreteria/v0.6/clade/IO/Aspect/Connx/Plug/Shell/Remote
Jump to navigation
Jump to search
| ||||||||||||||||||
About
- Purpose: a shell connection to a remote machine
History
Code
Current
interface iRemote extends BaseIface {
function NewTunnel(CredsIface $oICreds, ?int $nPortLocal=NULL) : TunnelIface;
}
abstract class caRemote extends BaseClass implements iRemote {}
Removed
2025-05-27
#
// ++ ACTION ++ //
// 2025-03-16 This succeeds in opening the tunnel (if sudo is invoked), but then the tunnel isn't used.
public function DoCommand(string|array $sCmd, BufferIface $oBuff) : CommOpIface {
$oScrn = $this->Screen();
$oAct = $this->NewAction();
#echo $this->Creds()->ReflectThis()->Report();
// ++ TUNNEL
#echo "Opening tunnel to $sSHost...".CRLF;
// 2025-03-16 If this works, then I think it must be an accidental kluge from earlier. TODO: fix later.
$oCreds = $this->Creds();
$oTunn = $this->NewTunnel($oCreds);
$oAct = $oTunn->Open();
echo ($oAct->GetOkay() ? $oScrn->GreenIt('Opened.') : ($oScrn->ErrorIt('Error: ').$oAct->GetMessage())).CRLF;
// -- TUNNEL
$oAct = parent::DoCommand($sCmd,$oBuff); // NOT TESTED
return $oAct;
}
// -- ACTION -- //