mirror of
				https://github.com/hauke68/Magallanes.git
				synced 2025-11-04 09:00:18 +01:00 
			
		
		
		
	[Nostromo] Apply Mess Detector recommendations
This commit is contained in:
		
							parent
							
								
									c9ec69e385
								
							
						
					
					
						commit
						949ca7c625
					
				@ -418,7 +418,7 @@ class Runtime
 | 
			
		||||
     * @param int $timeout Seconds to wait
 | 
			
		||||
     * @return Process
 | 
			
		||||
     */
 | 
			
		||||
    public function runRemoteCommand($cmd, $jail = true, $timeout = 120)
 | 
			
		||||
    public function runRemoteCommand($cmd, $jail, $timeout = 120)
 | 
			
		||||
    {
 | 
			
		||||
        $user = $this->getEnvParam('user');
 | 
			
		||||
        $sudo = $this->getEnvParam('sudo', false);
 | 
			
		||||
@ -430,14 +430,12 @@ class Runtime
 | 
			
		||||
            $cmdDelegate = sprintf('sudo %s', $cmd);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($jail) {
 | 
			
		||||
        $hostPath = rtrim($this->getEnvParam('host_path'), '/');
 | 
			
		||||
            if ($this->getReleaseId()) {
 | 
			
		||||
        if ($jail && $this->getReleaseId()) {
 | 
			
		||||
            $cmdDelegate = sprintf('cd %s/releases/%s && %s', $hostPath, $this->getReleaseId(), $cmdDelegate);
 | 
			
		||||
            } else {
 | 
			
		||||
        } elseif ($jail) {
 | 
			
		||||
            $cmdDelegate = sprintf('cd %s && %s', $hostPath, $cmdDelegate);
 | 
			
		||||
        }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $cmdRemote = str_replace(['"', '&', ';', '|'], ['\"', '\&', '\;', '\|'], $cmdDelegate);
 | 
			
		||||
        $cmdLocal = sprintf('ssh -p %d %s %s@%s sh -c \"%s\"', $sshConfig['port'], $sshConfig['flags'], $user, $host, $cmdRemote);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user