summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2013-08-29 00:12:54 -0700
committerPhil Davis <phil.davis@world.inf.org>2013-08-29 00:12:54 -0700
commit806e59790949110bfc7c5ca0588c1793d5e84ea7 (patch)
tree1ce17229b3aa9bbf8f9d11a6c17e6f0f2c0c9424
parentdf0cb10bbe3f2e61b37eeec786b5cfd96084d9cc (diff)
downloadpfsense-806e59790949110bfc7c5ca0588c1793d5e84ea7.zip
pfsense-806e59790949110bfc7c5ca0588c1793d5e84ea7.tar.gz
Call get_uptime_sec from functions.inc.php
to avoid code duplication
-rw-r--r--usr/local/www/includes/functions.inc.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php
index 2d3295a..90efcc5 100644
--- a/usr/local/www/includes/functions.inc.php
+++ b/usr/local/www/includes/functions.inc.php
@@ -8,6 +8,7 @@ if(Connection_Aborted()) {
}
require_once("config.inc");
+require_once("pfsense-utils.inc");
function get_stats() {
$stats['cpu'] = cpu_usage();
@@ -77,15 +78,8 @@ function get_gatewaystats() {
}
function get_uptime() {
- $boottime = "";
- $matches = "";
- exec("/sbin/sysctl -n kern.boottime", $boottime);
- preg_match("/sec = (\d+)/", $boottime[0], $matches);
- $boottime = $matches[1];
- $uptime = time() - $boottime;
+ $uptime = get_uptime_sec();
- if(intval($boottime) == 0)
- return;
if(intval($uptime) == 0)
return;
OpenPOWER on IntegriCloud