Skip to content

Commit

Permalink
Add SSH command prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjitse-E committed Jun 15, 2018
1 parent 9410beb commit b78ab0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/server-monitor.php
Expand Up @@ -21,6 +21,11 @@
*/
'concurrent_ssh_connections' => 5,

/*
* This string will be prepended to the ssh command generated by the package.
*/
'ssh_command_prefix' => '',

/*
* This string will be appended to the ssh command generated by the package.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/Models/Concerns/HasProcess.php
Expand Up @@ -29,8 +29,9 @@ public function getProcessCommand(): string
$portArgument = empty($this->host->port) ? '' : "-p {$this->host->port}";

$sshCommandSuffix = config('server-monitor.ssh_command_suffix');
$sshCommandPrefix = config('server-monitor.ssh_command_prefix');

return "ssh {$this->getTarget()} {$portArgument} {$sshCommandSuffix} 'bash -se <<$delimiter".PHP_EOL
return "ssh $sshCommandPrefix {$this->getTarget()} {$portArgument} {$sshCommandSuffix} 'bash -se <<$delimiter".PHP_EOL
.'set -e'.PHP_EOL
.$definition->command().PHP_EOL
.$delimiter."'";
Expand Down

0 comments on commit b78ab0d

Please sign in to comment.