add mod version to front page

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@397 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2011-09-14 19:59:56 +00:00
parent f235b05026
commit 0b566bca72
3 changed files with 21 additions and 0 deletions

View File

@ -120,6 +120,7 @@ $(document).ready(function() {
<a href=/jim/sqlite.html target=_blank>Sqlite</a>
</li>
</ul>
<!--#exec cmd="/mod/var/mongoose/include/modversion.jim" -->
</div>
<!--#include virtual="/lib/footer.shtml" -->

View File

@ -0,0 +1,9 @@
#!/mod/bin/jimsh
source /mod/var/mongoose/lib/setup
require system.class
puts "<font class=blood style=\"font-size: 0.9em; float: right; clear: right\">
Custom firmware version: [system modversion]
</font>"

View File

@ -20,6 +20,17 @@ proc {system hostname} {} {
return $hostname
}
proc {system modversion} {} {
if {[catch {set fp [open /etc/modversion r]}]} {
set modver "1.02"
} else {
set modver [string trim [read $fp]]
close $fp
}
lassign [split $modver ""] a b c
return [format "%d.%d%d" $a $b $c]
}
proc {system diskspace} {} {
switch [system model] {
HDR { set part /mnt/hd2 }