Explorar el Código

Update opr.php

Yeung Alan hace 5 años
padre
commit
f1549a5418
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      DiskInfo/opr.php

+ 3 - 3
DiskInfo/opr.php

@@ -17,9 +17,9 @@ if($ok == false){
 		$binary = "./bin/smartctl";
 	}else{
 		if(strpos(exec('uname -m'), 'arm') !== false){
-			$binary = "./smartctl_armv6";
+			$binary = "sudo ./smartctl_armv6";
 		}else{
-			$binary = "./smartctl_x86_64";
+			$binary = "sudo ./smartctl_x86_64";
 		}
 	}
 }
@@ -47,7 +47,7 @@ if($_GET["opr"] == "scan"){
     $DiskData["device"]["protocol"] = "Unknown";
 	$DiskData["ata_smart_attributes"]["table"] = [];
 	
-	$execResult = json_decode(shell_exec('sudo '.$binary.' -i '.$_GET["drive"].' -j -A'),true);
+	$execResult = json_decode(shell_exec($binary.' -i '.$_GET["drive"].' -j -A'),true);
 	//$execResult = json_decode(file_get_contents(explode("/",$_GET["drive"])[2].".txt"),true);
 	if($execResult == null){
 		die("");