summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-07-07 20:06:37 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-07-07 20:06:37 -0300
commit971de1f98a991a42c448415d34805d2970b86c4f (patch)
tree3c09598d67f04060af6113153c1995d804fb1244 /etc/inc/util.inc
parent79cd8239ed8dd7d2dd0d86475b62ee25c5d5736d (diff)
downloadpfsense-971de1f98a991a42c448415d34805d2970b86c4f.zip
pfsense-971de1f98a991a42c448415d34805d2970b86c4f.tar.gz
Convert almost all /sbin/sysctl calls to php functions
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc10
1 files changed, 2 insertions, 8 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index d4c7730..402ef3e 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -1638,14 +1638,8 @@ function set_single_sysctl($name, $value) {
* [1] real (actual) memory of the system, should be the size of the RAM card/s - e.g. 256 MBytes
*/
function get_memory() {
-
- $output = "";
- $_gb = exec("/sbin/sysctl -n hw.physmem", $output);
- $physmem = trim($output[0], " \n");
- unset($output);
- $_gb = exec("/sbin/sysctl -n hw.realmem", $output);
- $realmem = trim($output[0], " \n");
- unset($output, $_gb);
+ $physmem = get_single_sysctl("hw.physmem");
+ $realmem = get_single_sysctl("hw.realmem");
/* convert from bytes to megabytes */
return array(($physmem/1048576),($realmem/1048576));
}
OpenPOWER on IntegriCloud