Parcourir la source

update linux script to check script location only (#1899)

CauseFX il y a 3 ans
Parent
commit
5858680b40
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      api/functions/update-functions.php

+ 3 - 2
api/functions/update-functions.php

@@ -129,14 +129,15 @@ trait UpdateFunctions
 		ini_set('max_execution_time', 0);
 		set_time_limit(0);
 		$logFile = $this->root . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'log.txt';
-		$script = $this->root . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'linux-update.sh ' . $branch . ' > ' . $logFile . ' 2>&1';
+		$script = $this->root . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR . 'linux-update.sh';
+		$scriptExec = $script . ' ' . $branch . ' > ' . $logFile . ' 2>&1';
 		$checkScript = $this->testScriptFilePermissions($script);
 		if (!$checkScript) {
 			$this->setResponse(500, 'Update script permissions error');
 			$this->removeUpdateStatusFile();
 			return false;
 		}
-		$update = shell_exec($script);
+		$update = shell_exec($scriptExec);
 		$this->removeUpdateStatusFile();
 		if ($update) {
 			$this->setAPIResponse('success', $update, 200);