add build number to main screen

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1299 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2013-01-03 22:20:57 +00:00
parent 79bff00465
commit d6df19dd32
2 changed files with 16 additions and 1 deletions

View File

@ -3,10 +3,15 @@
source /mod/webif/lib/setup source /mod/webif/lib/setup
require system.class require system.class
set modver [system modversion]
set modbuild [system modbuild]
if {$modbuild > 0} {
append modver " (build $modbuild)"
}
puts "<font class=blood style=\"font-size: 0.9em; float: right; clear: right\"> puts "<font class=blood style=\"font-size: 0.9em; float: right; clear: right\">
Web interface version: [system pkgver webif]<br> Web interface version: [system pkgver webif]<br>
Custom firmware version: [system modversion] Custom firmware version: $modver
" "
if {![catch {set fhtcpversion [system fhtcpversion]}]} { if {![catch {set fhtcpversion [system fhtcpversion]}]} {
puts "<br>Humax Version: $fhtcpversion" puts "<br>Humax Version: $fhtcpversion"

View File

@ -43,6 +43,16 @@ proc {system modversion} {{short 0}} {
return [format "%d.%d%d" $a $b $c] return [format "%d.%d%d" $a $b $c]
} }
proc {system modbuild} {} {
if {[catch {set fp [open /etc/modbuild r]}]} {
return 0
} else {
set modbuild [string trim [read $fp]]
close $fp
}
return $modbuild
}
proc {system fhtcpversion} {} { proc {system fhtcpversion} {} {
set file "/etc/fhtcpversion" set file "/etc/fhtcpversion"
if {![file exists $file]} { set file "/root/fhtcpversion" } if {![file exists $file]} { set file "/root/fhtcpversion" }