summaryrefslogtreecommitdiffstats
path: root/etc/inc/pfsense-utils.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-12-07 01:26:19 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-12-07 01:26:19 +0000
commit6562edb8cc6b4251988cbeed9bd69f11e7726553 (patch)
treef30b606d425f7801af07800e00dea7ae86af0611 /etc/inc/pfsense-utils.inc
parent3184f4e79bf088892e6b31fc4192541932ebbaca (diff)
downloadpfsense-6562edb8cc6b4251988cbeed9bd69f11e7726553.zip
pfsense-6562edb8cc6b4251988cbeed9bd69f11e7726553.tar.gz
Only extract memory if dmesg.boot exists
Diffstat (limited to 'etc/inc/pfsense-utils.inc')
-rw-r--r--etc/inc/pfsense-utils.inc15
1 files changed, 9 insertions, 6 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 43f8bd6..6c90316 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1018,12 +1018,15 @@ function rmdir_recursive($path,$follow_links=false) {
* [0]real and [1]available
*/
function get_memory() {
- $mem = `cat /var/log/dmesg.boot | grep memory`;
- if (preg_match_all("/real memory = .* \((.*) MB/", $mem, $matches))
- $real = $matches[1];
- if (preg_match_all("/avail memory = .* \((.*) MB/", $mem, $matches))
- $avail = $matches[1];
- return array($real[0],$avail[0]);
+ if(file_exists("cat /var/log/dmesg.boot")) {
+ $mem = `cat /var/log/dmesg.boot | grep memory`;
+ if (preg_match_all("/real memory = .* \((.*) MB/", $mem, $matches))
+ $real = $matches[1];
+ if (preg_match_all("/avail memory = .* \((.*) MB/", $mem, $matches))
+ $avail = $matches[1];
+ return array($real[0],$avail[0]);
+ }
+ return array("64","64");
}
OpenPOWER on IntegriCloud