0){ $config_path = trim(file_get_contents("root.inf")); } $uuid = "win"; if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { //if this system is running under Windows environment if (!file_exists($config_path)) { mkdir($config_path, 0777, true); } if (!file_exists($config_path . "device_identity.config")){ $configFile = fopen($config_path . "device_identity.config", "w") or die("Permission Error."); $uuid = gen_uuid(); fwrite($configFile, $uuid); fclose($configFile); }else{ $uuid = file_get_contents($config_path . "device_identity.config"); } }else{ //if this system is running under linux environment if (file_exists($config_path) && file_exists($config_path . "device_identity.config")){ $uuid = file_get_contents($config_path . "device_identity.config"); }else{ $reuslt = ''; system('sudo mkdir /etc/AOB/', $result); system('sudo chmod 777 /etc/AOB/', $result); $configFile = fopen($config_path . "device_identity.config", "w") or die("Permission Error."); $uuid = gen_uuid(); fwrite($configFile, $uuid); fclose($configFile); } } echo "AOBP,Alive," . $uuid . "," . $_SERVER['SERVER_ADDR']; ?>