Compare commits

..

1 Commits

Author SHA1 Message Date
hummypkg
5251d71b99 tag
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/tags/0.13.3@1517 2a923420-c742-0410-a762-8d5b09965624
2013-04-03 22:45:45 +00:00
47 changed files with 100 additions and 908 deletions

View File

@@ -1,9 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 1.0.0
Version: 0.13.3
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.0.5),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.13),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools,tmenu(>=1.05),ffmpeg,id3v2
Suggests:
Depends: webif-channelicons(>=1.0.4-1),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.10),hmt(>=1.1.13),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools,tmenu(>=1.05)
Suggests: ffmpeg
Description: An evolving web interface for the Humax.

View File

@@ -19,11 +19,10 @@ grep -v webif/lib/bin/auto $cronf > $tmpf
# Add anacron jobs
ana=$PKG_ROOT/etc/anacrontab
egrep -v 'backup/backup.jim|diskattrs' $ana > $tmpf
grep -v 'backup/backup.jim' $ana > $tmpf
(
cat $tmpf
echo "1 8 sched_backup /mod/var/mongoose/cgi-bin/backup/backup.jim"
echo "1 5 diskattrs /mod/webif/lib/bin/diskattrs"
) > $ana
$PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 &

View File

@@ -10,7 +10,7 @@ if [ -f $cronf ]; then
fi
ana=/mod/etc/anacrontab
egrep -v 'backup/backup.jim|diskattrs' $ana > $tmpf
grep -v 'backup/backup.jim' $ana > $tmpf
cp $tmpf $ana
exit 0

View File

@@ -40,7 +40,6 @@ set nomobile [$settings nomobile]
set xepghours [$settings xepghours]
if {$xepghours == 0} { set xepghours 4 }
set genrededup [$settings genrededup]
set autolog [$settings autolog]
# Handle updates
@@ -81,7 +80,6 @@ handle_int_update pkgdev $pkgdev "Development Package Display"
handle_int_update notoolbar $notoolbar "Disable toolbar"
handle_int_update nomobile $nomobile "Disable mobile link"
handle_int_update genrededup $genrededup "Genre search dedup"
handle_int_update autolog $autolog "Auto-processing log level"
set acluser [cgi_get acluser "-"]
set aclpass [cgi_get aclpass "-"]
@@ -179,31 +177,6 @@ puts ">
</tr>
"
puts -nonewline "
<form class=auto id=autolog method=get action=$env(REQUEST_URI)>
<th class=key>Auto-processing log level</th>
<td><select id=autolog name=autolog
class=\"text ui-widget-content ui-corner-all\">
"
puts "<option value=0"
if {$autolog == 0} { puts " selected" }
puts ">Actions and errors only\n"
puts "<option value=1"
if {$autolog == 1} { puts " selected" }
puts ">Actions, errors and scan information\n"
puts "<option value=2"
if {$autolog == 1} { puts " selected" }
puts ">Debugging information\n"
puts "
</select>
<small>
<input name=autolog value=\"set\" type=submit>
</small>
<div id=autolog_output></div>
</td>
</form>
"
puts "
</table></fieldset>
<br><br>

View File

@@ -173,10 +173,7 @@ foreach e $records {
clock format $ee -format "%H:%M"])"
if {$showing} { append hxt " ($perc%)" }
set lbg $bg
if {[$e scheduled]} { set lbg "blueshade" }
puts "<div class=\"xeprog $lbg\"
puts "<div class=\"xeprog $bg\"
style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
<a class=event href=# xs=[$e get service_id]
xe=[$e get event_id] sch=[$e get sched_type]
@@ -224,7 +221,7 @@ puts "
onSelect: function(val, sel) {
var stt = \$(this).attr('stt');
// Extract date part
dval = Math.round(val / 86400000.0);
dval = ~~(val / 86400000);
// Extract current time part
var tm = ~~(stt % 86400);

View File

@@ -23,12 +23,8 @@ if {[system pkginst ffmpeg]} {
puts {
<li class=mp3><a href=#audio>Extract Audio</a></li>
<li class=mpg><a href=#mpg>Extract to MPG</a></li>
<li class=thm><a href=#thm>Set Thumbnail</a></li>
}
}
puts { <li><a href=#vthm>View Thumbnail</a></li> }
if $nicesplice {
puts {
<li class="cut"><a href=#crop>Crop</a></li>
@@ -291,9 +287,5 @@ Please wait...
</center>
</div>
<div id=bmpdialogue title="Recording Thumbnail" class=hidden>
<img id=thmbmp class=doublebmp src="about:blank">
</div>
}

View File

@@ -1,19 +0,0 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require cat
set file [cgi_get file]
set file "[file rootname $file].thm"
if {![file exists $file]} {
httpheader "text/plain"
puts "No such file, $file"
exit
}
httpheader "image/bmp"
cat "/mod/webif/lib/bmpheader"
cat $file

View File

@@ -11,7 +11,7 @@ set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts dlnaloc "127.0.0.1"] url
lassign [$ts dlnaloc] url
puts "
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />

View File

@@ -11,7 +11,7 @@ set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts dlnaloc "127.0.0.1"] url
lassign [$ts dlnaloc] url
if {$url eq ""} {
puts "This file has not been indexed by the media server.

View File

@@ -23,12 +23,7 @@ if {$type eq "ts"} {
<table class=keyval>
<tr>
<th>Title</th>
<td class=va>
"
if {[file exists "[file rootname $file].thm"]} {
puts "<img class=\"bmp va\" width=70 height=39 src=\"bmp.jim?file=$file\">"
}
puts "[$ts get title]</td>
<td>[$ts get title]</td>
</tr><tr>
<th>Synopsis</th>
<td>[$ts get synopsis]</td>

View File

@@ -96,13 +96,11 @@ proc entry {file} {{i 0}} {
set base [file rootname $file]
set thmok 0
if {$ext eq ".ts" && [file exists "${base}.nts"]} {
set type ts
set ts [ts fetch $file 1]
set img Video_TS
set omenu opt
if {[file exists "${base}.thm"]} { set thmok 1 }
} elseif {$ext eq ".hmt"} {
if {[file exists "${base}.ts"]} { continue }
# Sole hmt file indicates failure to track.
@@ -223,7 +221,7 @@ proc entry {file} {{i 0}} {
<img class=\"$omenu va\" border=0 width=45 type=$type did=$i
locked=$locked encd=$encd def=$def new=$new bx=$bx
shrunk=$shrunk rsize=$rsz
odencd=$odencd dlna=$dlna thmok=$thmok
odencd=$odencd dlna=$dlna
src=/images/181_1_00_Help5_OPT_Plus.png>
</a>
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
@@ -308,7 +306,7 @@ proc s_time {a b} {
set files [readdir -nocomplain $dir]
switch $order {
1 { set files [lsort -command s_time $files] }
default { set files [lsort -nocase $files] }
default { set files [lsort $files] }
}
foreach file $files { entry "$dir/$file" }

View File

@@ -178,20 +178,6 @@ function new_callback(file, type, id)
$.get(url, function() { window.location.reload(true); });
}
function thumbnail_callback(file, type, id)
{
var el = 'div.bf#' + id;
var results = el + ' .results';
$(results)
.html('<img src=/img/loading.gif>Generating thumbnail, ' +
'please wait...')
.slideDown('slow')
.load('/browse/thumbnail.jim?file=' + file)
.delay(3000)
.slideUp('slow');
$('div.bf#' + id + ' img.opt').attr('thmok', 1);
}
function rename_submit()
{
var s = $('#renameform_form').serialize();
@@ -271,16 +257,6 @@ function preparemenu(el, menu)
else
$(menu).disableContextMenuItems('#crop');
if (el.attr('odencd') == 0)
$(menu).enableContextMenuItems('#thm');
else
$(menu).disableContextMenuItems('#thm');
if (el.attr('thmok') == 1)
$(menu).enableContextMenuItems('#vthm');
else
$(menu).disableContextMenuItems('#vthm');
$(menu).enableContextMenuItems('#strip');
if (el.attr('rsize') > 4294967296)
@@ -448,19 +424,6 @@ var menuclick = function(action, el, pos)
$('#renameform').dialog('open');
break;
case 'thm':
window.location.href = '/browse/thumbnail/index.jim?file=' +
file;
break;
case 'vthm':
// window.open('/browse/bmpw.jim?file=' + file, 'hxwebifbmp',
// 'height=156,width=280,toolbar=no,' +
// 'scrollbars=no,menubar=no,location=no,titlebar=no');
$('#thmbmp').attr('src', 'bmp.jim?file=' + file);
$('#bmpdialogue').dialog('open');
break;
case 'download':
window.location.href = '/browse/download.jim?file=' +
file + '&base=' +
@@ -785,18 +748,6 @@ var dmenuclick = function(action, el, pos)
close: function() { $('#savestream_name').val(''); }
});
$('#bmpdialogue').dialog({
autoOpen: false,
height: 'auto', width: 'auto',
modal: true,
buttons: {
"Close": function() {
$(this).dialog('close');
}
},
close: function() { $('#thmbmp').attr('src', 'about:blank'); }
});
// Create re-usable confirmation dialogue.
$confirm = $('#confirm').dialog({
modal: true, autoOpen: false,

View File

@@ -1,19 +0,0 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class cat
httpheader "image/bmp"
set rfile [cgi_get file]
set pos [cgi_get pos 0]
if {![catch {set ts [ts fetch $rfile]}]} {
$ts mkbmp $pos ".pos$pos"
set f "[file rootname $rfile].pos$pos.bmp"
cat $f
file delete $f
}

View File

@@ -1,17 +0,0 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require cat
httpheader "image/bmp"
set rfile [cgi_get file]
set pos [cgi_get pos 0]
set f "[file rootname $rfile].pos$pos.bmp"
if {[file exists $f]} {
cat $f
file delete $f
}

View File

@@ -1,98 +0,0 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class pretty_size
header
set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts bookmarks] book
if {$book eq ""} { set book 0 }
set pos [cgi_get pos $book]
set pos $($pos + 0)
if {$pos < 0} { set pos 0 }
puts "
<script type=text/javascript src=script.js></script>
<script type=text/javascript src=/js/enadis.js></script>
<fieldset class=cleft>
<legend>Replace Thumbnail</legend>
<table class=keyval cellpadding=5>
<tr><th>File:</th><td>
<span class=hidden id=dir>[file dirname $rfile]</span>
<span id=file>$rfile</span>
</td></tr>
<tr><th>Length:</th><td>[clock format $len -format %T]</td></tr>
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
<tr><th>Bookmarks:</th><td>[$ts get bookmarks] ($book second(s))</td></tr>
<tr><th>Thumbnail:</th><td>
<img class=doublebmp src=\"../bmp.jim?file=[cgi_quote_url $rfile]\">
</td></tr>
</table>
"
if {[$ts get definition] eq "HD"} {
set start $($pos - 0.5)
set incr 1.0
} else {
set start $($pos - 1)
set incr 2.0
}
if {$start < 0} { set start 0 }
set limit $($start + $incr)
puts "<div style=\"width=100%; text-align: center\">
<button id=back>Back to media browser</button>
<br /> <br />
<form method=get action=index.jim>
<input type=hidden name=file value=\"$rfile\">
Thumbnails from around
<input name=pos id=pos size=5 maxlength=4 value=\"$pos\">
second(s) into recording.
</form>
<button class=mvpos pos=[expr $pos - 30]>&lt;&lt; 30 seconds</button>
<button class=mvpos pos=[expr $pos - 5]>&lt; 5 seconds</button>
<button id=repos>Update</button>
<button class=mvpos pos=[expr $pos + 5]>&gt; 5 seconds</button>
<button class=mvpos pos=[expr $pos + 30]>&gt;&gt; 30 seconds</button>
</div>
<span id=start class=hidden>$start</span>
<span id=end class=hidden>$limit</span>
<table class=keyval cellpadding=5>
<tr>
"
for {set i [expr $start + 0.0]} {$i <= $limit} {set i [expr $i + 0.5]} {
lappend times $i
puts "<th style=\"text-align: center\">
@ <span class=mark>$i</span>s</th>"
}
puts "</tr><tr>"
foreach i $times {
puts "<td>
<img class=bmp src=/img/generating.png pos=$i>
</td>"
}
puts "</tr><tr>"
foreach i $times {
puts "<td style=\"text-align: center\">
<button class=usethm pos=\"$i\">Use</button>
</td>"
}
puts "</tr>"
puts "</table>"

View File

@@ -1,21 +0,0 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class
httpheader
set rfile [cgi_get file]
set s [cgi_get s 0]
set e [cgi_get e $($s + 2)]
set i [expr [cgi_get i 0.5] + 0.0]
if {![catch {set ts [ts fetch $rfile]}]} {
$ts cleanbmp
for {set n [expr $s + 0.0]} {$n <= $e} {set n [expr $n + $i]} {
puts "Generating thumbnail for pos $n"
$ts mkbmp $n ".pos$n"
}
}

View File

@@ -1,58 +0,0 @@
$(document).ready(function() {
var dir = $('#dir').text();
var file = $('#file').text();
$('button').button();
function go(pos)
{
window.location.href = 'index.jim?file=' +
encodeURIComponent(file) + '&pos=' + pos;
}
$('button.mvpos').disable().on('click', function(e) {
e.preventDefault();
var pos = $(this).attr('pos');
go(pos);
});
$('#repos').disable().on('click', function(e) {
e.preventDefault();
var pos = $('#pos').val();
go(pos);
});
$('#back').on('click', function(e) {
e.preventDefault();
window.location.href = '/browse/index.jim?dir=' +
encodeURIComponent(dir);
});
$('button.usethm').disable().on('click', function(e) {
e.preventDefault();
var pos = $(this).attr('pos');
$('button,input').disable();
$.get('set.jim?file=' + encodeURIComponent(file) + '&pos=' + pos,
function() {
window.location.href = '/browse/index.jim?dir=' +
encodeURIComponent(dir);
});;
});
var start = $('#start').text();
var end = $('#end').text();
$.get('mkrange.jim?file=' + encodeURIComponent(file) +
'&s=' + start + '&e=' + end, function() {
$('img.bmp').each(function(i) {
var pos = $(this).attr('pos');
$(this).attr('src',
'fetch.jim?file=' + encodeURIComponent(file) +
'&pos=' + pos);
});
$('button').enable();
});
});

View File

@@ -1,15 +0,0 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class
httpheader
set file [cgi_get file]
set pos [cgi_get pos 0]
if {![catch {set ts [ts fetch $file]}]} {
$ts mkthm $pos
}

View File

@@ -72,6 +72,5 @@
.contextMenu LI.mpg A { background-image: url(/img/context/mpg.png); }
.contextMenu LI.mp3 A { background-image: url(/img/context/mp3.png); }
.contextMenu LI.clock A { background-image: url(/img/context/clock.png); }
.contextMenu LI.thm A { background-image: url(/img/context/thumb.png); }

View File

@@ -65,33 +65,13 @@ div.footer
padding-top: 2em;
}
div.owarningbox
div.warningbox
{
background: url('/img/redshade.png') repeat-x;
padding: 0.5em;
margin: 1em;
}
div.warningbox
{
width: 60%;
background: url('/img/redshade.png') repeat-x;
background-size: 100%;
#color: #005000;
border: 1px solid #7a4707;
padding: 10px;
position: relative;
top: -2px;
left: -2px;
font-weight: bold;
z-index: 30;
box-shadow: 2px 2px 11px #666;
-moz-box-shadow: 2px 2px 11px #666;
-webkit-box-shadow: 2px 2px 11px #666;
border-radius: 5px;
-moz-border-radius: 5px;
}
table
{
empty-cells: show;
@@ -430,18 +410,3 @@ div#restart_block
z-index: 31;
}
img.bmp, img.doublebmp
{
transform: scaleY(-1);
-webkit-transform: scaleY(-1);
-o-transform: scaleY(-1);
height: 78px;
width: 140px;
}
img.doublebmp
{
height: 156px;
width: 280px;
}

View File

@@ -9,12 +9,10 @@ set logdirs {/var/log /mod/tmp /mnt/hd3}
set logext {.log}
set log [cgi_get file 0]
set unlink [cgi_get unlink 0]
set ldir [file dirname $log]
if {[file dirname $log] in $logdirs && [file extension $log] in $logext} {
file copy -force "/dev/null" $log
if {$unlink} { file delete $log }
puts "Cleared $log"
exit
}

View File

@@ -2,12 +2,12 @@
package require cgi
source /mod/webif/lib/setup
require system.class settings.class
require system.class
header
set device [system disk]
set settings [settings]
set space [system diskspace]
set device [string range [lindex $space 5] 0 end-1]
set smart Unknown
set line ""
@@ -16,11 +16,9 @@ catch { set line [exec /mod/bin/smartctl -H $device | sed -n 5p] } msg
if {$msg ne "" && $line eq ""} { set line $msg }
if {$line ne ""} {
set smart [string range [lindex [split $line :] 1] 1 end]
$settings _tval_setting "SMART_status" $smart
}
puts "
<script type=text/javascript src=/js/enadis.js></script>
<h3 class=va>
<img class=va width=100 src=/img/disc.png>
SMART data read from device $device
@@ -101,18 +99,9 @@ foreach line [split [exec /mod/bin/smartctl -A $device] "\n"] {
id name flags val worst thresh type updated when rval
set class normal
switch $id {
5 {
$settings _nval_setting "SMART_realloc" $rval
if {$rval > 0} { set class orangeshade }
}
197 {
$settings _nval_setting "SMART_pending" $rval
if {$rval > 0} { set class redshade }
}
198 {
$settings _nval_setting "SMART_offline" $rval
if {$rval > 0} { set class redshade }
}
5 { if {$rval > 0} { set class orangeshade } }
197 { if {$rval > 0} { set class redshade } }
198 { if {$rval > 0} { set class redshade } }
}
puts "<tr class=$class>"
puts "
@@ -155,7 +144,6 @@ foreach line [split $msg "\n"] {
regsub -all -- {[[:space:]][[:space:]]+} $line "|" line
if {[incr i] < 7} continue
lassign [split $line "|"] id name status remaining when lba
if {[string length $id] > 10} continue
puts "<tr>
<td>$id</td>
<td>$name</td>
@@ -169,28 +157,6 @@ foreach line [split $msg "\n"] {
puts {
</table>
</fieldset>
<div class=cleft style="padding-top: 2em">
<button id=diskack>Acknowledge any current disk faults.</button>
</div>
<script type=text/javascript>
$(function() {
$('#diskack')
.button()
.on('click', function(e) {
e.preventDefault();
$('button').disable();
$.get('diskack.jim', function() {
window.location.reload(true);
});
});
});
</script>
}
footer

View File

@@ -1,16 +0,0 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require settings.class
httpheader
set settings [settings]
foreach attr {realloc pending offline} {
set val [$settings _nval_setting "SMART_$attr"]
if {$val <= 0} continue
$settings _nval_setting "SMART_ack_$attr" $val
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 754 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -19,6 +19,7 @@ $(document).ready(function() {
</script>
<!--#exec cmd="/mod/webif/include/menuicons.jim" -->
<!--#exec cmd="/mod/webif/include/menuplugins.jim" -->
</div>
<div class=footer>

View File

@@ -25,8 +25,6 @@ source /mod/webif/html/lib/topbar.jim
puts "<div id=restart_block>"
source /mod/webif/include/restart.jim
puts "</div>"
source /mod/webif/include/diskcheck.jim
source /mod/webif/include/notify.jim
puts {
<div style="clear: both">

View File

@@ -8,13 +8,12 @@ puts {
<h2>Backup/Restore</h2>
<div id=restore_warning class="hidden warningbox">
<div>
<center>
<b>!!!!!!!!!!!!!! PLEASE NOTE !!!!!!!!!!!!!!
<br><br>
After restoring the scheduled recordings you <b>MUST</b> restart the box using
the link at the top of the screen or via the remote control.
</div></div>
</div>
<div style="clear: both; float: left; width: 40%; border: 1px solid grey;
padding: 1em">

View File

@@ -1,69 +0,0 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require settings.class
set smartattrs {realloc pending offline}
set smartattribs(SMART_status) "Unknown"
foreach sa $smartattrs {
set smartattribs(SMART_$sa) 0
set smartattribs(SMART_ack_$sa) 0
}
foreach line [[settings] smartdata] {
lassign $line x name x n x t
if {$name eq "SMART_status"} {
set smartattribs($name) $t
} else {
set smartattribs($name) $n
}
}
# (SMART_ack_status 0 SMART_ack_pending 0 SMART_status PASSED SMART_pending 7 SMART_ack_realloc 0 SMART_ack_offline 0 SMART_realloc 0 SMART_offline 7)
set smartmsg ""
if {$smartattribs(SMART_status) ne "PASSED"} {
append smartmsg \
"Disk overall health assessment is: $smartattribs(SMART_status)\n"
}
foreach sa $smartattrs {
if {$smartattribs(SMART_$sa) != $smartattribs(SMART_ack_$sa)} {
append smartmsg \
"Disk $sa sector count is: $smartattribs(SMART_$sa)"
if {$smartattribs(SMART_ack_$sa) > 0} {
append smartmsg " (was $smartattribs(SMART_ack_$sa))"
}
append smartmsg "\n"
}
}
if {$smartmsg ne ""} {
if {![dict exists $env REQUEST_URI]} { set env(REQUEST_URI) "" }
puts "
<div id=smartwarning class=warningbox><center>
!! WARNING !!
<br><br>
There appear to be some hardware problems with the internal hard disk on
this device.
<br><br>
[string map {"\n" "<br>"} $smartmsg]
"
if {$env(REQUEST_URI) ne "/diag/disk.jim"} {
puts "
<br>
<a href=/diag/disk.jim>Go to disk diagnostics</a>
"
} else {
puts "
<br>
Don't panic; for help and assistance, visit
<a target=_blank href=http://hummy.tv/>hummy.tv</a>
"
}
puts "
</center></div>
"
}

View File

@@ -4,9 +4,7 @@ source /mod/webif/lib/setup
require system.class
lassign [system diskspace] size used perc free fperc
set dsindex $($perc * 25 / 100 + 1)
if {$dsindex > 25} { set dsindex 25 }
set dsfile [format "%02d" $dsindex]
set file [format "%02d" [expr {$perc * 25 / 100 + 1}]]
# The HD model only has the USB images which are blue. I prefer the green
# one so use those if available.
@@ -21,7 +19,7 @@ puts "
<span style=\"float: right;
background:url('/images/345_1_27_ST_USB_BG.png')
no-repeat\">
<img src=/images/${prefix}_$dsfile.png>
<img src=/images/${prefix}_$file.png>
</span>
<span style=\"float: right\">

View File

@@ -1,13 +1,9 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require settings.class plugin
require settings.class
proc menuitem {title icon link {width 217} {height 0} {extra ""}} {{num 0}} {
if {$title eq "-reset"} {
set num 0
return
}
incr num
if {$title eq ""} return
if {$num > 4} {
@@ -19,8 +15,7 @@ proc menuitem {title icon link {width 217} {height 0} {extra ""}} {{num 0}} {
<div class=left num=$num>
<center>
<a href=$link>
<img src=$icon ${extra}border=0 "
if {$width} { puts -nonewline " width=$width" }
<img src=$icon ${extra}border=0 width=$width"
if {$height} { puts -nonewline " height=$height" }
puts -nonewline ">
</a>
@@ -67,22 +62,3 @@ menuitem "Settings" "/images/326_1_00_Menu_Settings.png" \
menuitem "Diagnostics" "/img/diagnostics.png" \
/diag/diag.jim 217 228
eval_plugins menu
menuitem "-reset" "" ""
puts {</div><div style="clear: both; padding-top: 3em">}
menuitem "hummy.tv<br>Forums" "/img/forum.png" \
"http://hummy.tv/ target=_blank" 0 100 \
"style=\"padding: 1em\""
menuitem "hummy.tv<br>Wiki" "/img/wiki.png" \
"http://wiki.hummy.tv/ target=_blank" 0 100 \
"style=\"padding: 1em\""
menuitem "Things Every<br>Owner Should Know" "/img/started.png" \
"http://hummy.tv/forum/threads/1858/ target=_blank" 0 100 \
"style=\"padding: 1em\""
menuitem "Twitter<br>Feed" "/img/silver-twitter-bird-button.png" \
"http://twitter.com/HummyPkg target=_blank" 0 100 \
"style=\"padding: 1em\""

View File

@@ -1,30 +0,0 @@
#!/mod/bin/jimsh
if {[file exists /mod/tmp/notify.log]} {
source /mod/webif/lib/setup
require cat
puts "
<div id=sysnotify class=warningbox><center>
!! WARNING !!
<br><br>
You have pending system notifications:
<br><br>
<pre>
"
cat /mod/tmp/notify.log
puts {
</pre>
<button id=sysnotify_ack>Acknowledge</button>
</center></div>
<script type=text/javascript>
$('#sysnotify_ack').button().on('click', function() {
$('#sysnotify').slideUp('slow');
$.get('/diag/clearlog.jim?file=/mod/tmp/notify.log&unlink=1');
});
</script>
}
}

View File

@@ -1,10 +1,9 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require lock system.class ts.class tdelete pretty_size browse.class \
safe_delete settings.class
require lock system.class ts.class tdelete pretty_size browse.class safe_delete
set loglevel [[settings] autolog]
set debug 0
if {![acquire_lock webif_auto]} {
puts "Cannot acquire exclusive lock, terminating."
@@ -19,8 +18,8 @@ if {[file exists $logfile] && [file size $logfile] > 2097152} {
}
set logfd [open "/mod/tmp/auto.log" "a+"]
proc log {msg {level 1}} {
if {$level > $::loglevel} return
proc log {msg {always 0}} {
if {!$::debug && !$always} return
puts $::logfd "[\
clock format [clock seconds] -format "%d/%m/%Y %H:%M"\
] - $msg"
@@ -42,7 +41,7 @@ proc endclock {size} {
}
set scanstart [clock milliseconds]
log "-------------------------------------------------------"
log "-------------------------------------------------------" 1
# is_listening is relatively expensive so it is checked once globally at
# the start and then if the server is not listening then no decrypt
@@ -52,13 +51,13 @@ log "-------------------------------------------------------"
# of the run.
if {[system is_listening 9000]} {
set dlnaok 1
log "DLNA Server is running." 2
if {$::debug} { log "DLNA Server is running." }
} else {
set dlnaok 0
log "DLNA Server is NOT running." 2
if {$::debug} { log "DLNA Server is NOT running." }
}
log "Media scan starting, DLNA server status: $dlnaok"
log "Media scan starting, DLNA server status: $dlnaok" 1
proc dsc {{size 0}} {
set free [system diskfree]
@@ -67,7 +66,7 @@ proc dsc {{size 0}} {
set req $($size * 3 + 1073741824)
if {$free < $req} {
log "Insufficient disk space. Require=$req, Free=$free" 0
log "Insufficient disk space. Require=$req, Free=$free" 1
exit
}
}
@@ -77,11 +76,11 @@ dsc
set tmp "/mod/tmp/webif_auto"
if {![file exists $tmp]} {
if {[catch {file mkdir $tmp} msg]} {
log "Cannot create temporary directory - $tmp ($msg)" 0
log "Cannot create temporary directory - $tmp ($msg)" 1
exit
}
} elseif {![file isdirectory $tmp]} {
log "Cannot create temporary directory - $tmp (file exists)" 0
log "Cannot create temporary directory - $tmp (file exists)" 1
exit
}
@@ -94,14 +93,14 @@ if {[system pkginst undelete]} {
set dustbin ""
}
log "Dustbin: $dustbin" 2
log "Dustbin: $dustbin"
proc dedup {dir} {
log "DEDUP: \[$dir]" 2
log "DEDUP: \[$dir]"
loop i 0 1 {
foreach line [split \
[exec /mod/webif/html/dedup/dedup -yes -auto $dir] "\n"] {
log $line 2
log $line 1
}
}
}
@@ -112,41 +111,39 @@ proc do_expire {ts} {
# Calculate the age of the file in days.
set age $(([clock seconds] - [$ts get start]) / 86400.0)
log " EXPIRE: $file (age = $age)" 2
log " EXPIRE: $file (age = $age)"
if {$age > $ax_days} {
log " EXPIRE: $file ($age > $ax_days)" 1
if {[$ts inuse]} {
log " EXPIRE: $file ($age > $ax_days)"
log " In use."
log " In use." 1
return
}
if {[safe_delete $file]} {
log " EXPIRE: $file ($age > $ax_days)" 0
log " Deleted." 0
log " Deleted." 1
}
}
}
proc do_shrink {ts} {
global tmp dustbin tsgroup
set file [$ts get file]
if {[$ts flag "Shrunk"]} {
log " $file - already shrunk." 2
log " Already shrunk."
return
}
set file [file rootname [$ts get file]]
if {[$ts inuse]} {
log " $file - in use." 2
log " $file - in use." 1
return
}
if {[catch {
set perc [exec /mod/bin/stripts -aq $file]
} msg]} {
log " Error: $msg" 0
log " Error: $msg" 1
return
}
if {[string match {*%} $perc]} {
@@ -156,25 +153,24 @@ proc do_shrink {ts} {
}
if {$perc == 0} {
log " $file - already shrunk." 2
log " Already shrunk."
$ts set_shrunk
return
}
set size [$ts size]
dsc $size
startclock
log " SHRINK: $file" 0
log " Estimate $perc% saving." 0
log " Shrinking..." 0
log " SHRINK: $file" 1
log " Estimate $perc% saving." 1
log " Shrinking..." 1
if {[catch {
foreach line [split \
[exec nice -n 19 /mod/bin/stripts -q $file $tmp/shrunk] \
"\n"] {
log $line 0
log $line 1
}
} msg]} {
log "Error during shrink: $msg" 0
system notify "$file - auto-shrink - error $msg."
log "Error during shrink: $msg" 1
return
}
@@ -200,7 +196,7 @@ proc do_shrink {ts} {
}
}
$ts set_shrunk
log "Done... [endclock $size]" 0
log "Done... [endclock $size]" 1
}
proc do_decrypt {ts} {
@@ -211,72 +207,37 @@ proc do_decrypt {ts} {
set bfile [file tail $file]
if {![$ts flag "ODEncrypted"]} {
log " $file - Already decrypted." 2
log " Already decrypted."
return
}
lassign [$ts dlnaloc "127.0.0.1"] url
lassign [$ts dlnaloc] url
if {$url eq ""} {
log " $file - Not yet indexed."
log " Not yet indexed."
return
}
if {![system is_listening 9000]} {
log " $file - DLNA Server not running." 2
log " DLNA Server not running."
set ::dlnaok 0
return
}
if {[$ts inuse]} {
log " $file - In use."
log " In use." 1
return
}
# Check that the file is not already decrypted by analysing it.
set anencd [exec /mod/bin/stripts -qE $rfile]
if {$anencd != "1"} {
log " $file - already decrypted but the HMT flag is wrong." 0
system notify "$file - auto-decrypt - file is already decrypted but the HMT flag is wrong."
return
}
# Perform the decryption by requesting the file from the DLNA server.
set size [$ts size]
dsc $size
set flagfile "$tmp/decrypting.$bfile"
exec /mod/bin/busybox/touch $flagfile
startclock
log " DECRYPT: $rfile" 0
log " DLNA: $url" 0
log " DECRYPT: $rfile" 1
log " DLNA: $url" 1
exec wget -O "$tmp/$bfile" $url
if {[file size $file] != [file size "$tmp/$bfile"]} {
log " $file - File size mismatch." 0
file delete "$tmp/$bfile"
file delete $flagfile
return
}
# Check if the file is in use. It is possible that the file is
# now being played even though it was free when decryption started.
if {[$ts inuse]} {
log " $file - In use."
file delete "$tmp/$bfile"
file delete $flagfile
return
}
# Copy the HMT file over for stripts
set thmt "$tmp/[file rootname $bfile].hmt"
file copy "$rfile.hmt" $thmt
# Check that the file is no longer encrypted by analysing it.
set anencd [exec /mod/bin/stripts -qE "$tmp/[file rootname $bfile]"]
file delete $thmt
if {$anencd != "0"} {
log " $file - File did not decrypt properly." 0
system notify "$file - auto-decrypt failed."
file delete "$tmp/$bfile"
log " File size mismatch." 1
file delete $flagfile
return
}
@@ -288,7 +249,7 @@ proc do_decrypt {ts} {
# Patch the HMT - quickest way to get back to a playable file.
exec /mod/bin/hmt -encrypted "$rfile.hmt"
log " Removing/binning old copy." 0
log " Removing/binning old copy."
# Move the old recording to the bin if undelete is installed.
if {$dustbin ne ""} {
set bin [_del_bindir $file "webif_autodecrypt"]
@@ -307,7 +268,7 @@ proc do_decrypt {ts} {
} else {
tdelete "$rfile.encrypted"
}
log "Done... [endclock $size]" 0
log "Done... [endclock $size]" 1
file delete $flagfile
}
@@ -322,7 +283,7 @@ proc do_mpg {ts} {
}
if {[$ts flag "ODEncrypted"]} {
log " $file - Not decrypted." 2
log " Not decrypted."
return
}
@@ -332,24 +293,23 @@ proc do_mpg {ts} {
}
if {[$ts inuse]} {
log " $file - In use."
log " In use." 1
return
}
dsc [$ts size]
log " MPG: $file" 0
log " Converting..." 0
log " MPG: $file" 1
log " Converting..." 1
if {[catch {
foreach line [split \
[exec nice -n 19 /mod/bin/ffmpeg -y -benchmark -v 0 \
-i $file.ts \
-map 0:0 -map 0:1 \
-vcodec copy -acodec copy $tmp/mpg.mpg] "\n"] {
log $line 0
log $line 1
}
} msg]} {
log "Error during mpg extract: $msg" 0
system notify "$file - auto-mpg - error $msg."
log "Error during mpg extract: $msg" 1
return
}
@@ -368,34 +328,32 @@ proc do_mp3 {ts} {
}
if {[$ts flag "ODEncrypted"]} {
log " $file - Not decrypted." 2
log " Not decrypted."
return
}
if {[$ts get definition] eq "HD"} {
# Cannot extract a useful MP3 from a HD recording.
log " $file - High definition." 2
return
}
if {[$ts inuse]} {
log " $file - In use."
log " In use." 1
return
}
dsc [$ts size]
log " MP3: $file" 0
log " Converting..." 0
log " MP3: $file" 1
log " Converting..." 1
if {[catch {
foreach line [split \
[exec nice -n 19 /mod/bin/ffmpeg -y -benchmark -v 0 \
-i $file.ts \
-f mp3 -vn -acodec copy $tmp/mp3.mp3] "\n"] {
log $line 0
log $line 1
}
} msg]} {
log "Error during mp3 extract: $msg" 0
system notify "$file - auto-mp3 - error $msg."
log "Error during mp3 extract: $msg" 1
return
}
@@ -405,7 +363,7 @@ proc do_mp3 {ts} {
--comment "[$ts get synopsis]" \
--album "[$ts get channel_name]" \
--year "[clock format [$ts get start] -format {%Y}]" \
"$tmp/mp3.mp3"] 0
"$tmp/mp3.mp3"]
}
# Move the MP3 into the local directory
@@ -422,28 +380,28 @@ proc entries {dir callback} {
}
proc shrink {dir} {
log "SHRINK: \[$dir]" 2
log "SHRINK: \[$dir]"
entries $dir do_shrink
}
proc decrypt {dir} {
log "DECRYPT: \[$dir]" 2
log "DECRYPT: \[$dir]"
if {$::dlnaok} { entries $dir do_decrypt }
}
proc mpg {dir} {
log "MPG: \[$dir]" 2
log "MPG: \[$dir]"
entries $dir do_mpg
}
proc mp3 {dir} {
log "MP3: \[$dir]" 2
log "MP3: \[$dir]"
entries $dir do_mp3
}
proc expire {dir} {
global ax_days
log "EXPIRE: \[$dir]" 2
log "EXPIRE: \[$dir]"
set ax_days [{dir expiry} $dir]
entries $dir do_expire
@@ -454,10 +412,10 @@ proc scan {dir attr {force 0}} {{indent 0}} {
incr indent 2
log "[string repeat " " $indent]\[$dir]" 2
log "[string repeat " " $indent]\[$dir]"
if {$dir eq $dustbin} {
log "Dustbin, skipping." 2
log "Dustbin, skipping."
return
}
@@ -465,18 +423,18 @@ proc scan {dir attr {force 0}} {{indent 0}} {
# Special folder
file stat "$dir/" st
if {$st(dev) != $::rootdev} {
log "Special folder on different device, skipping." 2
log "Special folder on different device, skipping."
return
}
if {$force} {
set force 0
log "Special folder, overriding recursion." 2
log "Special folder, overriding recursion."
}
}
# Recursion
if {!$force && [file exists "$dir/.auto${attr}r"]} {
log "[string repeat " " $indent] (R)" 2
log "[string repeat " " $indent] (R)"
set force 1
}
@@ -496,20 +454,20 @@ proc scan {dir attr {force 0}} {{indent 0}} {
set root [system mediaroot]
file stat "$root/" rootstat
set rootdev $rootstat(dev)
log "Root device: $rootdev" 2
#log "Root device: $rootdev" 1
if {[llength $argv] > 0} {
set loglevel 2
set debug 1
foreach arg $argv { scan $root $arg }
} else {
foreach arg {dedup decrypt shrink mpg mp3 expire} {
set st [clock milliseconds]
scan $root $arg
log "$arg scan completed in [elapsed $st] seconds."
log "$arg scan completed in [elapsed $st] seconds." 1
}
}
release_lock webif_auto
log "Media scan completed in [elapsed $scanstart] seconds."
log "Media scan completed in [elapsed $scanstart] seconds." 1

View File

@@ -1,51 +0,0 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class settings.class
if {[system model] eq "HD"} exit
set disk [system disk]
set settings [settings]
# Extract overall SMART status.
set smart ""
set line ""
# smartctl uses non-zero exit status to indicate health hence catch.
catch { set line [exec /mod/bin/smartctl -H $disk | sed -n 5p] } msg
if {$msg ne "" && $line eq ""} { set line $msg }
if {$line ne ""} {
set smart [string range [lindex [split $line :] 1] 1 end]
$settings _tval_setting "SMART_status" $smart
}
foreach line [split [exec /mod/bin/smartctl -A -f brief $disk] "\n"] {
regsub -all -- {[[:space:]]+} $line " " line
regsub -all -- {^[[:space:]]+} $line "" line
lassign [split $line] id name flags val worst thresh when rval
if {![string is integer $id]} continue
set attrs($id) $rval
}
#puts "Attrs: ($attrs)"
puts "SMART: ($smart)"
puts "Reallocated: $attrs(5)"
puts "Pending: $attrs(197)"
puts "Offline: $attrs(198)"
if {[dict exists $attrs 5]} {
$settings _nval_setting "SMART_realloc" $attrs(5)
}
if {[dict exists $attrs 197]} {
$settings _nval_setting "SMART_pending" $attrs(197)
if {$attrs(197) < [$settings _nval_setting "SMART_ack_pending"]} {
$settings _nval_setting "SMART_ack_pending" $attrs(197)
}
}
if {[dict exists $attrs 198]} {
$settings _nval_setting "SMART_offline" $attrs(198)
if {$attrs(198) < [$settings _nval_setting "SMART_ack_offline"]} {
$settings _nval_setting "SMART_ack_offline" $attrs(198)
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 B

View File

@@ -2,7 +2,7 @@
if {![exists -proc cat]} {
proc cat {file} {
if {[catch {set fp [open $file r}]} { return }
puts -nonewline [read $fp]
puts [read $fp]
close $fp
}
}

View File

@@ -5,6 +5,7 @@ if {![exists -proc sqlite3.open]} { package require sqlite3 }
require settings.class progressbar rsv.class mwildcard
set ::epgpath /mnt/hd1/dvbepg/epg.dat
set ::epgdbpath /mnt/hd1/epg.db
set ::hdepgpath /media/drive1/epgsavedata
@@ -21,6 +22,8 @@ if {[file exists $::epgdbpath]} {
set ::qepg 1
}
set ::rsvlookup [rsv lookuptab]
# * service_id, event_id, start, duration, encrypted, name, text
# * warning, content code, content type,
# * event CRID, series CRID, rec CRID
@@ -45,7 +48,7 @@ class epg {
channel_crid ""
channel_hsvc 0
sched_type -1
sched_type 0
rsv 0
}
@@ -172,42 +175,13 @@ epg method get_rsv {} {
}
epg method process_sched {} {
$self scheduled
}
set rsvlookup ""
epg method scheduled {} {
global rsvlookup
if {$sched_type >= 0} { return $sched_type }
set sched_type 0
if {$rsvlookup eq ""} {
set rsvlookup [rsv lookuptab]
#puts $rsvlookup
if {$event_crid ne "" && "$channel_hsvc$event_crid" in $::rsvlookup} {
set sched_type 1
} elseif {$series_crid ne "" &&
"$channel_hsvc$series_crid" in $::rsvlookup} {
set sched_type 2
}
set p 0
foreach key [list \
"$service_id:$event_id" \
[string tolower "$service_id:$channel_crid$series_crid"] \
[string tolower "$service_id:$channel_crid$event_crid"] \
] {
#puts "Check key ($key)"
if {[dict exists $rsvlookup $key]} {
set p $rsvlookup($key)
break
}
}
switch $p {
S { set sched_type 2 }
E { set sched_type 1 }
default { set sched_type 0 }
}
return $sched_type
}
epg method icon_set {{height 0}} {

View File

@@ -318,40 +318,6 @@ proc {rsv list} {{table tbl_reservation} {extra ""}} {
}
proc {rsv lookuptab} {} {
set records {}
foreach tab {tbl_reservation pending} {
set res [$::rsvdb query "
select usSvcId, usevtid, ucCRIDType, szCRID,
ucRecKind
from $tab left join channel.TBL_SVC
on $tab.hSvc = channel.TBL_SVC.hSvc
where ersvtype <= 3
"]
foreach rec $res {
if {$rec(ucRecKind) == 4} {
set p "S"
} else {
set p "E"
}
set records("$rec(usSvcId):$rec(usevtid)") $p
if {$rec(szCRID) eq ""} continue
if {$rec(ucCRIDType) == 49} {
set p "E"
} elseif {$rec(ucCRIDType) == 50} {
set p "S"
} else {
continue
}
set records([\
string tolower "$rec(usSvcId):$rec(szCRID)"]) $p
}
}
return $records
}
proc {rsv xlookuptab} {} {
set records {}
foreach tab {tbl_reservation pending} {
set res [$::rsvdb query "

View File

@@ -26,7 +26,6 @@ class settings {
nomobile 0
xepghours 4
genrededup 0
autolog 0
}
settings method hostname {{name ""}} {
@@ -101,29 +100,6 @@ settings method _nval_setting {name {val -1}} {
}
}
settings method _tval_setting {name {val -1}} {
global settingsdb
if {$val == -1} {
# Get
set res [$settingsdb query "
select tval from settings
where name = '$name'
"]
if {$res ne ""} {
return [lindex [lindex $res end] end]
}
return 0
} else {
# Set
$settingsdb query "
replace into settings(name,tval)
values('$name', '%s')
" $val
return 0
}
}
settings method channel_group {{group -1}} {
return [$self _nval_setting channel_group $group]
}
@@ -164,10 +140,6 @@ settings method sortorder {{val -1}} {
return [$self _nval_setting sortorder $val]
}
settings method autolog {{level -1}} {
return [$self _nval_setting autolog $level]
}
settings method channel_groups {} {
set ret ""
set db [sqlite3.open /var/lib/humaxtv/setup.db]
@@ -260,14 +232,3 @@ settings method delacluser {user} {
return $msg
}
settings method smartdata {} {
global settingsdb
set res [$settingsdb query "
select name, nval, tval from settings
where name like 'SMART_%%'
"]
return $res
}

View File

@@ -139,10 +139,6 @@ proc {system diskspace} {} {
return [list $size $used $perc $free $fperc $dev]
}
proc {system disk} {} {
return [string range [lindex [system diskspace] 5] 0 end-1]
}
proc {system diskfree} {} {
switch [system model] {
HDR { set part /mnt/hd2 }
@@ -248,11 +244,3 @@ proc {system is_listening} {mport} {
return [llength [system listening $mport]]
}
proc {system notify} {msg} {
set logfd [open "/mod/tmp/notify.log" "a+"]
puts $logfd "[\
clock format [clock seconds] -format "%d/%m/%Y %H:%M"\
] - $msg"
$logfd close
}

View File

@@ -235,53 +235,6 @@ ts method dlnaloc {{urlbase 0}} {
if {$url ne "" } { return [list $url $mime] } else { return {} }
}
ts method cleanbmp {} {
set bfile [file rootname $file]
foreach f [glob -nocomplain "${bfile}*.bmp"] {
file delete $f
}
}
ts method mkbmps {{offset 0}} {
set bfile [file rootname $file]
if {[catch {
exec /mod/bin/ffmpeg -loglevel fatal -ss $offset -i $file \
-vf fps=fps=2 -frames 5 \
-pix_fmt argb -vf vflip -s 140x78 "${bfile}%d.bmp"
} msg]} {
puts "ERROR: $msg"
return 0
}
return 1
}
ts method mkbmp {{offset 0} {ext ""}} {
set bfile [file rootname $file]
if {[catch {
exec /mod/bin/ffmpeg -loglevel fatal -ss $offset -i $file \
-frames 1 -pix_fmt argb -vf vflip -s 140x78 "$bfile$ext.bmp"
} msg]} {
puts "ERROR: $msg"
return 0
}
return 1
}
ts method mkthm {{offset 0}} {
if {![$self mkbmp $offset]} { return 0 }
set bfile [file rootname $file]
if {[catch {
exec /bin/dd if=$bfile.bmp of=$bfile.thm~ bs=54 skip=1
} msg]} {
puts "ERROR: $msg"
return 0
}
exec /bin/echo -n " " >> $bfile.thm~
file rename -force $bfile.thm~ $bfile.thm
tdelete $bfile.bmp
return 1
}
proc {ts renamegroup} {from to} {
global tsgroup