From 0b566bca7250fa4c62a39a3729ff2daee1d55438 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 14 Sep 2011 19:59:56 +0000 Subject: [PATCH] add mod version to front page git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@397 2a923420-c742-0410-a762-8d5b09965624 --- var/mongoose/html/index.shtml | 1 + var/mongoose/include/modversion.jim | 9 +++++++++ var/mongoose/lib/system.class | 11 +++++++++++ 3 files changed, 21 insertions(+) create mode 100755 var/mongoose/include/modversion.jim diff --git a/var/mongoose/html/index.shtml b/var/mongoose/html/index.shtml index 2e9d552..65810d6 100644 --- a/var/mongoose/html/index.shtml +++ b/var/mongoose/html/index.shtml @@ -120,6 +120,7 @@ $(document).ready(function() { Sqlite + diff --git a/var/mongoose/include/modversion.jim b/var/mongoose/include/modversion.jim new file mode 100755 index 0000000..097bb84 --- /dev/null +++ b/var/mongoose/include/modversion.jim @@ -0,0 +1,9 @@ +#!/mod/bin/jimsh + +source /mod/var/mongoose/lib/setup +require system.class + +puts " + Custom firmware version: [system modversion] +" + diff --git a/var/mongoose/lib/system.class b/var/mongoose/lib/system.class index f17873e..113a16d 100644 --- a/var/mongoose/lib/system.class +++ b/var/mongoose/lib/system.class @@ -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 }