diff options
author | Renato Botelho <renato@netgate.com> | 2015-07-31 10:03:34 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-07-31 10:03:34 -0300 |
commit | 5779ade6707ba530517da239d9ec3fc751d17d83 (patch) | |
tree | 9295a06ae80c1dd54611e7c279c42e3e242a6790 /etc/inc/pfsense-utils.inc | |
parent | 6fed300c6ae8c5bcac03f867daf737e2676dcc30 (diff) | |
download | pfsense-5779ade6707ba530517da239d9ec3fc751d17d83.zip pfsense-5779ade6707ba530517da239d9ec3fc751d17d83.tar.gz |
Introduce a new item to $g global, 'product_version' and stop reading /etc/version all around
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r-- | etc/inc/pfsense-utils.inc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index 22b0be0..93719ad 100644 --- a/etc/inc/pfsense-utils.inc +++ b/etc/inc/pfsense-utils.inc @@ -802,7 +802,7 @@ function check_firmware_version($tocheck = "all", $return_php = true) { } $version = php_uname('r'); $version = explode('-', $version); - $rawparams = array("firmware" => array("version" => trim(file_get_contents('/etc/version'))), + $rawparams = array("firmware" => array("version" => $g['product_version']), "kernel" => array("version" => $version[0]), "base" => array("version" => $version[0]), "platform" => trim(file_get_contents('/etc/platform')), @@ -841,7 +841,7 @@ function host_firmware_version($tocheck = "") { $os_version = trim(substr(php_uname("r"), 0, strpos(php_uname("r"), '-'))); return array( - "firmware" => array("version" => trim(file_get_contents('/etc/version', " \n"))), + "firmware" => array("version" => $g['product_version']), "kernel" => array("version" => $os_version), "base" => array("version" => $os_version), "platform" => trim(file_get_contents('/etc/platform', " \n")), @@ -1773,9 +1773,9 @@ function download_file($url, $destination, $verify_ssl = true, $connect_timeout curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); if (!isset($config['system']['host_uuid'])) { - curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version") . ' : ' . get_single_sysctl('kern.hostuuid'))); + curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . get_single_sysctl('kern.hostuuid')); } else { - curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version"))); + curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']); } if (!empty($config['system']['proxyurl'])) { @@ -1819,9 +1819,9 @@ function download_file_with_progress_bar($url_file, $destination_file, $readbody curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout); curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); if (!isset($config['system']['host_uuid'])) { - curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version") . ' : ' . get_single_sysctl('kern.hostuuid'))); + curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version'] . ' : ' . get_single_sysctl('kern.hostuuid')); } else { - curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . rtrim(file_get_contents("/etc/version"))); + curl_setopt($ch, CURLOPT_USERAGENT, $g['product_name'] . '/' . $g['product_version']); } if (!empty($config['system']['proxyurl'])) { |