slitaz-forge rev 77

tank: Fixed index.php to display the current cpu that tank is running on.
author Christopher Rogers <slaxemulator@gmail.com>
date Sun Aug 14 10:51:38 2011 +0000 (2011-08-14)
parents a3a70403f3a9
children c4b562748fa2
files tank/web/index.php
line diff
     1.1 --- a/tank/web/index.php	Sun Jul 31 12:07:26 2011 +0000
     1.2 +++ b/tank/web/index.php	Sun Aug 14 10:51:38 2011 +0000
     1.3 @@ -51,7 +51,13 @@
     1.4  			public directory or cron jobs.
     1.5  		</p>
     1.6  		<p>
     1.7 -			Tank CPU is a AMD Dual Core 2 GHz - 2GB RAM - Located next to Lausanne,
     1.8 +			Tank CPU is a <?php system("sed -e '/^model name/!d;s/.*Intel(R) //;" .         
     1.9 +			"s/@//;s/(.*)//;s/CPU //;s/.*AMD //;s/.*: //;s/Processor //' </proc/cpuinfo |" .
    1.10 +			" awk '{ s=$0; n++ } END { if (n == 2) printf \"dual \";" .
    1.11 +			"if (n == 4) printf \"quad \"; print s }' ")?> -
    1.12 +			<?php system("free | awk '/Mem:/ { x=2*$2-1; while (x >= 1024) { x /= 1024; ".
    1.13 +			"n++ }; y=1; while (x > 2) { x /= 2; y *= 2}; ".
    1.14 +			"printf \"%d%cB RAM\",y,substr(\"MG\",n,1) }' ")?>  - Located next to Lausanne,
    1.15  			Switzerland. Tank is also monitored by RRDtool which provides 
    1.16  			<a href="graphs.php">graphical stats</a>.
    1.17  		</p>