|
|
@ -41,19 +41,11 @@ class SshConnector extends CPHPBaseClass
|
|
|
|
|
|
|
|
|
|
|
|
return $this->DoCommand($command, $throw_exception);
|
|
|
|
return $this->DoCommand($command, $throw_exception);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (SshCommandException $e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new SshCommandException($e->getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (SshConnectException $e)
|
|
|
|
catch (SshConnectException $e)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$error = $e->getMessage();
|
|
|
|
$error = $e->getMessage();
|
|
|
|
throw new SshCommandException("Could not run command {$command}: Failed to connect: {$error}");
|
|
|
|
throw new SshCommandException("Could not run command {$command}: Failed to connect: {$error}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (SshExitException $e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new SshExitException($e->getMessage(), $e->getCode());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function RunCommandCached($command, $throw_exception = false)
|
|
|
|
public function RunCommandCached($command, $throw_exception = false)
|
|
|
|