auto fixencflags

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2220 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2015-01-24 21:52:30 +00:00
parent 73f6fd5519
commit 38fdd3aaa6
4 changed files with 43 additions and 5 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 1.2.0-4
Version: 1.2.0-5
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.14),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.0),hmt(>=1.2.0),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,mongoose

View File

@ -36,13 +36,13 @@ puts "
"
foreach tw [$db query {
select tsIdx, szNetName, usTsID, ulFrequency, ucLevel,
ucQuality, eTransMode
ucQuality, eTransMode, eConstellation
from TBL_TS join TBL_NET using (netIdx)
order by ulFrequency
}] {
lassign $tw \
x tsIdx x netName x usTsID x ulFrequency x ucLevel x ucQuality \
x eTransMode
x eTransMode x eConstellation
puts "
<tr class=odd>
@ -60,7 +60,11 @@ foreach tw [$db query {
order by usLcn
} $tsIdx]
set mux "Local"
if {$eConstellation == 1} {
set mux "Local"
} else {
set mux "Unknown"
}
set ehs 0
foreach chan $channels {
lassign $chan x lcn x name

View File

@ -304,7 +304,8 @@ proc do_decrypt {ts} {
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. Run the 'fixencflags' diagnostic."
# Fix...
exec /mod/webif/lib/bin/fixencflags $file
return
}

33
webif/lib/bin/fixencflags Executable file
View File

@ -0,0 +1,33 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require system.class ts.class
proc fix_one {ts} {
set flag [$ts flag "ODEncrypted"]
set rfile [file rootname [$ts get file]]
set anencd [exec /mod/bin/stripts -qE $rfile]
if {$flag && $anencd != "1"} {
exec /mod/bin/hmt -encrypted "$rfile.hmt"
puts "FIXED ENC $rfile"
}
if {!$flag && $anencd == "1"} {
exec /mod/bin/hmt +encrypted "$rfile.hmt"
puts "FIXED DEC $rfile"
}
}
if {![llength $argv]} {
ts iterate [lambda {ts} {
fix_one $ts
}]
exit
}
foreach file $argv {
if {![string match {*.ts} $file]} continue
if {[catch {set ts [ts fetch $file]}]} continue
if {$ts == 0} continue
fix_one $ts
}