updates for running under apache

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif@162 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2011-06-07 14:45:01 +00:00
parent d3e7adfd1f
commit 01b067bdeb
11 changed files with 41 additions and 26 deletions

View File

@ -1,6 +1,9 @@
#!/mod/bin/jimsh
set pid [exec pgrep humaxtv]
puts "Content-Type: text/html"
puts ""
if {[catch {set pid [exec pgrep humaxtv]}]} { exit }
if {[catch {set data [exec lsof -p $pid | grep Video | fgrep .ts]} ]} {
exit
@ -40,8 +43,6 @@ foreach line $lines {
}
if {[llength $output]} {
puts "Content-Type: text/html"
puts ""
puts [join $output "<br>\n"]
}

View File

@ -1,4 +1,4 @@
<!--#include virtual="/lib/header.shtml" -->
<!--#exec "/mod/var/mongoose/include/db.jim" -->
<!--#exec cmd="/mod/var/mongoose/include/db.jim" -->
<!--#include virtual="/lib/footer.shtml" -->

View File

@ -4,6 +4,6 @@ Search EPG: <input name=term size=20 maxlength=255>
<input type=checkbox name=full>Search descriptions as well as titles.
<input type=submit value=Search>
</form>
<!--#exec "/mod/var/mongoose/include/epg.jim" -->
<!--#exec cmd="/mod/var/mongoose/include/epg.jim" -->
<!--#include virtual="/lib/footer.shtml" -->

View File

@ -17,9 +17,12 @@ function updateResults()
var r = document.getElementById('status');
if (r && request.readyState == 4 && request.status == 200)
{
r.style.display = 'block';
var t = document.getElementById('status_txt');
t.innerHTML = request.responseText;
if (t.length)
{
r.style.display = 'block';
t.innerHTML = request.responseText;
}
}
}

View File

@ -1,7 +1,7 @@
<!-- Start of footer -->
<div class=footer>
<ul>
<li><!--#exec "/mod/var/mongoose/include/mediatomb.jim" -->
<li><!--#exec cmd="/mod/var/mongoose/include/mediatomb.jim" -->
MediaTomb Web Interface</a>
</li>
<li>

View File

@ -8,7 +8,7 @@
Humax HD[R] Fox T2
</span>
<!-- Start include diskspace -->
<!--#exec "/mod/var/mongoose/include/diskspace.jim" -->
<!--#exec cmd="/mod/var/mongoose/include/diskspace.jim" -->
<!-- End include diskspace -->
</div>
<div class=right><img src=/images/154_1_00_WIN_MD116_3R.png></div>

View File

@ -9,6 +9,6 @@ Results...
</div>
</div>
<!--#exec "/mod/var/mongoose/include/packages.jim" -->
<!--#exec cmd="/mod/var/mongoose/include/packages.jim" -->
<!--#include virtual="/lib/footer.shtml" -->

View File

@ -1,4 +1,4 @@
<!--#include virtual="/lib/header.shtml" -->
<!--#exec "/mod/var/mongoose/include/sched.jim" -->
<!--#exec cmd="/mod/var/mongoose/include/sched.jim" -->
<!--#include virtual="/lib/footer.shtml" -->

View File

@ -53,6 +53,6 @@ Results...
<th>Auto Startup</th>
<th>Status</th>
</tr>
<!--#exec "/mod/var/mongoose/include/services.jim" -->
<!--#exec cmd="/mod/var/mongoose/include/services.jim" -->
</table>
<!--#include virtual="/lib/footer.shtml" -->

View File

@ -1,12 +1,18 @@
#!/mod/bin/jimsh
foreach df [split [exec df -h] "\n\r"] {
if [string match *sda2* $df] {
regsub -all -- {[[:space:]]+} $df " " df
set fields [split $df]
set size [lindex $fields 1]
set used [lindex $fields 2]
set perc [string trimright [lindex $fields 4] "%"]
if {[os.gethostname] eq "hosting"} {
set size "1TB"
set used "100GB"
set perc "10"
} else {
foreach df [split [exec df -h] "\n\r"] {
if [string match *sda2* $df] {
regsub -all -- {[[:space:]]+} $df " " df
set fields [split $df]
set size [lindex $fields 1]
set used [lindex $fields 2]
set perc [string trimright [lindex $fields 4] "%"]
}
}
}

View File

@ -4,7 +4,10 @@ if {[expr ! [exists -proc sqlite3.open ]]} { package require sqlite3 }
source /mod/var/mongoose/lib/progressbar
set channeldb 0
catch {
set channeldb [sqlite3.open /var/lib/humaxtv/channel.db]
}
# * service_id, event_id, start, duration, encrypted, name, text
# * warning, content code, content type,
@ -143,7 +146,7 @@ proc {epg parse} {line} {
proc {epg cleanup} {} {
global channeldb
$channeldb close
if $channeldb { $channeldb close }
}
proc {epg exec} {mode args} {
@ -178,12 +181,14 @@ proc {epg fetch} {mode args} {
foreach line [split [epg exec $mode {*}$args] "\n"] {
set record [epg parse $line]
set chan [lindex [$channeldb query {
select szSvcName, usLcn from TBL_SVC
where usSvcId = %s} "[$record get service_id]"
] 0]
$record channel $chan(usLcn) \
[string range $chan(szSvcName) 1 end]
if $channeldb {
set chan [lindex [$channeldb query {
select szSvcName, usLcn from TBL_SVC
where usSvcId = %s} "[$record get service_id]"
] 0]
$record channel $chan(usLcn) \
[string range $chan(szSvcName) 1 end]
}
lappend records $record
}