diff options
author | Renato Botelho <garga@pfSense.org> | 2013-08-31 07:31:04 -0700 |
---|---|---|
committer | Renato Botelho <garga@pfSense.org> | 2013-08-31 07:31:04 -0700 |
commit | f89f3b3d2197bcaeb5b97575e25b97581bd9d207 (patch) | |
tree | c3e6d7e71c7bac899fffbea222369dcef19b20c9 /usr/local/www/includes | |
parent | b097a7cfa9f42d513823f0db7f047684faf8fe28 (diff) | |
parent | 806e59790949110bfc7c5ca0588c1793d5e84ea7 (diff) | |
download | pfsense-f89f3b3d2197bcaeb5b97575e25b97581bd9d207.zip pfsense-f89f3b3d2197bcaeb5b97575e25b97581bd9d207.tar.gz |
Merge pull request #787 from phil-davis/master
Provide get_uptime_sec in a common include file
Diffstat (limited to 'usr/local/www/includes')
-rw-r--r-- | usr/local/www/includes/functions.inc.php | 10 |
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 6a60fcf..4a8ffc8 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; |