Revision: 2746
          http://ipcop.svn.sourceforge.net/ipcop/?rev=2746&view=rev
Author:   owes
Date:     2009-04-27 20:15:45 +0000 (Mon, 27 Apr 2009)

Log Message:
-----------
Difference between Alpine and non-Alpine cobalt machines

Modified Paths:
--------------
    ipcop/trunk/html/cgi-bin/sysinfo.cgi

Modified: ipcop/trunk/html/cgi-bin/sysinfo.cgi
===================================================================
--- ipcop/trunk/html/cgi-bin/sysinfo.cgi        2009-04-27 20:14:01 UTC (rev 
2745)
+++ ipcop/trunk/html/cgi-bin/sysinfo.cgi        2009-04-27 20:15:45 UTC (rev 
2746)
@@ -137,18 +137,40 @@
 if (-e "/proc/cobalt") {
     print "<a name='cobalt'/>\n";
     &Header::openbox('100%', 'left', "$Lang::tr{'system info cobalt'}:");
+    
+    my $outputsystype = `/bin/cat /proc/cobalt/systype`;
+    my $outputserialnumber = `/bin/cat /proc/cobalt/serialnumber`;
+    my $outputfan = `/bin/cat /proc/cobalt/faninfo`;
+    my $outputvoltage = `/bin/cat /proc/cobalt/sensors/voltage`;
     my $outputthermal = `/bin/cat /proc/cobalt/sensors/thermal`;
     my $outputraminfo = `/bin/cat /proc/cobalt/raminfo`;
-    my $outputsystype = `/bin/cat /proc/cobalt/systype`;
-    my $outputserialnumber = `/bin/cat /proc/cobalt/serialnumber`;
+
+    $outputsystype = &Header::cleanhtml($outputsystype);
+    $outputserialnumber = &Header::cleanhtml($outputserialnumber);
+    $outputfan = &Header::cleanhtml($outputfan);
+    if (index($outputsystype, 'Alpine') != -1) {
+        (@lines) = split(/\n/, $outputfan);
+        $outputfan = "";
+        foreach my $line (@lines) {
+            next if ($line =~ /fan 0|fan 4/);
+            $outputfan .= $line."\n";
+        }
+    }
     $outputthermal = &Header::cleanhtml($outputthermal);
+    $outputvoltage = &Header::cleanhtml($outputvoltage);
     $outputraminfo = &Header::cleanhtml($outputraminfo);
-    $outputsystype = &Header::cleanhtml($outputsystype);
-    $outputserialnumber = &Header::cleanhtml($outputserialnumber);
-    print "<pre>Cpu Temperature In Degrees Celsius:\n$outputthermal \n";
-    print "Ram Slot Information:\n$outputraminfo \n";
-    print "Cobalt System Type:\n$outputsystype \n";
-    print "Cobalt System Serial Number:\n$outputserialnumber<\/pre>";
+    
+    print "<pre>Cobalt System Type:\n$outputsystype \n";
+    print "Cobalt System Serial Number:\n$outputserialnumber \n";
+    if (index($outputsystype, 'Alpine') != -1) {
+        print "Fan Info:\n$outputfan \n";
+        print "Voltage:\n$outputvoltage \n";
+    }
+    else {
+        print "Cpu Temperature In Degrees Celsius:\n$outputthermal \n";
+    }
+    print "Ram Slot Information:\n$outputraminfo<\/pre>";
+
     &Header::closebox();
 }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Crystal Reports &#45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty&#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ipcop-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipcop-svn

Reply via email to