Yeung Alan 5 lat temu
rodzic
commit
f1549a5418
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      DiskInfo/opr.php

+ 3 - 3
DiskInfo/opr.php

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