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,6 +100,9 @@ class Utils{
|
||||
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
||||
}
|
||||
}elseif($os === "linux"){
|
||||
if(file_exists("/etc/machine-id")){
|
||||
$machine .= file_get_contents("/etc/machine-id");
|
||||
}else{
|
||||
@exec("ifconfig", $mac);
|
||||
$mac = implode("\n", $mac);
|
||||
if(preg_match_all("#HWaddr[ \t]{1,}([0-9a-f:]{17})#", $mac, $matches)){
|
||||
@ -110,7 +113,7 @@ class Utils{
|
||||
}
|
||||
$machine .= implode(" ", $matches[1]); //Mac Addresses
|
||||
}
|
||||
$machine .= file_exists("/etc/machine-id") ? file_get_contents("/etc/machine-id") : "";
|
||||
}
|
||||
}elseif($os === "android"){
|
||||
$machine .= @file_get_contents("/system/build.prop");
|
||||
}elseif($os === "mac"){
|
||||
|
Loading…
x
Reference in New Issue
Block a user