Differential D7710 Diff 17414 src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
Show All 38 Lines | public function getExecFuture($command) { | ||||
$full_command = call_user_func_array('csprintf', $argv); | $full_command = call_user_func_array('csprintf', $argv); | ||||
if ($this->getConfig('platform') === 'windows') { | if ($this->getConfig('platform') === 'windows') { | ||||
// On Windows platforms we need to execute cmd.exe explicitly since | // On Windows platforms we need to execute cmd.exe explicitly since | ||||
// most commands are not really executables. | // most commands are not really executables. | ||||
$full_command = 'C:\\Windows\\system32\\cmd.exe /C '.$full_command; | $full_command = 'C:\\Windows\\system32\\cmd.exe /C '.$full_command; | ||||
} | } | ||||
// NOTE: The "-t -t" is for psuedo-tty allocation so we can "sudo" on some | |||||
// systems, but maybe more trouble than it's worth? | |||||
return new ExecFuture( | return new ExecFuture( | ||||
'ssh -t -t -o StrictHostKeyChecking=no -p %s -i %P %P@%s -- %s', | 'ssh -o StrictHostKeyChecking=no -p %s -i %P %P@%s -- %s', | ||||
$this->getConfig('port'), | $this->getConfig('port'), | ||||
$this->passphraseSSHKey->getKeyfileEnvelope(), | $this->passphraseSSHKey->getKeyfileEnvelope(), | ||||
$this->passphraseSSHKey->getUsernameEnvelope(), | $this->passphraseSSHKey->getUsernameEnvelope(), | ||||
$this->getConfig('host'), | $this->getConfig('host'), | ||||
$full_command); | $full_command); | ||||
} | } | ||||
} | } |