summaryrefslogtreecommitdiffstats
path: root/usr/local/www/includes
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-09-15 03:21:17 +0000
committerBill Marquette <billm@pfsense.org>2005-09-15 03:21:17 +0000
commit7979a809331c706f621fd4d6d40b667a81fa806a (patch)
treec57b2a29174fddef03e48b50cc56b25700d3eb78 /usr/local/www/includes
parent1804023da9ad604cb57af7e934352ef84e127736 (diff)
downloadpfsense-7979a809331c706f621fd4d6d40b667a81fa806a.zip
pfsense-7979a809331c706f621fd4d6d40b667a81fa806a.tar.gz
Make temp monitor really work - make a little more modular too
Diffstat (limited to 'usr/local/www/includes')
-rw-r--r--usr/local/www/includes/functions.inc.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php
index dddc5ab..9878105 100644
--- a/usr/local/www/includes/functions.inc.php
+++ b/usr/local/www/includes/functions.inc.php
@@ -65,8 +65,27 @@ function get_pfstate() {
return $curentries . $maxstates;
}
-function get_temp($type) {
- switch($type) {
+function has_temp() {
+ if(`/sbin/dmesg -a | /usr/bin/grep net4801` <> "") {
+ /* Initialize hw monitor */
+ exec("/usr/local/sbin/env4801 -i");
+ return true;
+ }
+
+ /* should only reach here if there is no hardware monitor */
+ return false;
+}
+
+function get_hwtype() {
+ if(`/sbin/dmesg -a | /usr/bin/grep net4801` <> "") {
+ return "4801";
+ }
+
+ return;
+}
+
+function get_temp() {
+ switch(get_hwtype()) {
case '4801':
$ret = rtrim(`/usr/local/sbin/env4801 | /usr/bin/grep Temp |/usr/bin/cut -c24-25`);
break;
OpenPOWER on IntegriCloud