diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 0820357e7..a8af84410 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -400,7 +400,6 @@ class Application_Model_Preference public static function GetSystemInfo($returnArray=false, $p_testing=false) { exec('/usr/bin/airtime-check-system --no-color', $output); - $output = preg_replace('/\s+/', ' ', $output); $systemInfoArray = array(); @@ -409,7 +408,12 @@ class Application_Model_Preference if(isset($info[1])){ $key = str_replace(' ', '_', trim($info[0])); $key = strtoupper($key); - $systemInfoArray[$key] = $info[1]; + if ($key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM' || + $key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION' || + $key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES' || + $key == 'PLAYOUT_ENGINE_CPU_PERC' ) { + $systemInfoArray[$key] = $info[1]; + } } } diff --git a/utils/airtime-check-system.php b/utils/airtime-check-system.php index a91fa4efa..22ff7362c 100644 --- a/utils/airtime-check-system.php +++ b/utils/airtime-check-system.php @@ -34,7 +34,7 @@ class AirtimeCheck { { // Need to check that we are superuser before running this. $euid = posix_geteuid(); - $user = posix_getlogin(); + $user = exec('whoami'); if($euid != 0 && $user != "www-data"){ echo "Must be root user.\n"; exit(1);