sshClient()->execute($script); if (! $result->isSuccessful()) { throw new RuntimeException(trim($result->getErrorOutput()) ?: 'Remote command failed.'); } return trim($result->getOutput()); } }