* @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link https://fogproject.org */ require '../commons/base.inc.php'; session_write_close(); ignore_user_abort(true); set_time_limit(0); header('Content-Type: text/plain'); // changed from text/event-stream since output is simple text if (isset($_POST['url'])) { // Prevent an unauthenticated user from making arbitrary requests. FOGCore::checkAuthAndCSRF(); $res = $FOGURLRequests->process(filter_input(INPUT_POST, 'url')); foreach ((array) $res as &$response) { echo $response; unset($response); } exit; } $kernelvers = function ($kernel) { $currpath = sprintf( '%s%sservice%sipxe%s%s', BASEPATH, DS, DS, DS, $kernel ); if (!file_exists($currpath)) { return 'Not found'; } $basepath = escapeshellarg($currpath); // Using 'strings' and grep to extract version number like 1.5.10 $findstr = sprintf( 'strings %s | grep -m 1 -oP "\d+\.\d+\.\d+(?=.*\([0-9a-zA-Z]*@)"', $basepath ); $output = shell_exec($findstr); return $output !== null ? trim($output) : 'Unknown'; }; printf("FOG Version: %s\n", FOG_VERSION); printf("bzImage Version: %s\n", $kernelvers('bzImage')); printf("bzImage32 Version: %s\n", $kernelvers('bzImage32')); $armVersion = $kernelvers('arm_Image'); if ($armVersion === 'Not found' || $armVersion === 'Unknown' || empty($armVersion)) { printf("arm_Image Version: Not installed\n"); } else { printf("arm_Image Version: %s\n", $armVersion); }