mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-29 14:49:59 +00:00
Use best method to create identifier on linux
This commit is contained in:
parent
b2b4cf788c
commit
f64caf6c96
@ -100,17 +100,20 @@ class Utils{
|
|||||||
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
||||||
}
|
}
|
||||||
}elseif($os === "linux"){
|
}elseif($os === "linux"){
|
||||||
@exec("ifconfig", $mac);
|
if(file_exists("/etc/machine-id")){
|
||||||
$mac = implode("\n", $mac);
|
$machine .= file_get_contents("/etc/machine-id");
|
||||||
if(preg_match_all("#HWaddr[ \t]{1,}([0-9a-f:]{17})#", $mac, $matches)){
|
}else{
|
||||||
foreach($matches[1] as $i => $v){
|
@exec("ifconfig", $mac);
|
||||||
if($v == "00:00:00:00:00:00"){
|
$mac = implode("\n", $mac);
|
||||||
unset($matches[1][$i]);
|
if(preg_match_all("#HWaddr[ \t]{1,}([0-9a-f:]{17})#", $mac, $matches)){
|
||||||
|
foreach($matches[1] as $i => $v){
|
||||||
|
if($v == "00:00:00:00:00:00"){
|
||||||
|
unset($matches[1][$i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
||||||
}
|
}
|
||||||
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
|
||||||
}
|
}
|
||||||
$machine .= file_exists("/etc/machine-id") ? file_get_contents("/etc/machine-id") : "";
|
|
||||||
}elseif($os === "android"){
|
}elseif($os === "android"){
|
||||||
$machine .= @file_get_contents("/system/build.prop");
|
$machine .= @file_get_contents("/system/build.prop");
|
||||||
}elseif($os === "mac"){
|
}elseif($os === "mac"){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user