forked from hummypkg/webif
Compare commits
19 Commits
df-browse-
...
df-bbrawpa
| Author | SHA1 | Date | |
|---|---|---|---|
| b0d2fa32dc | |||
| ec8fe177c5 | |||
| 40c7ebcf89 | |||
| 7da9ca930a | |||
| 536b1977b1 | |||
|
|
d7c15163e1 | ||
| 879c458256 | |||
| 1a25e2a3f1 | |||
| 006a04683a | |||
| 3623a26a08 | |||
| c428a367a1 | |||
| 480108f3a2 | |||
| 2884a82dbf | |||
| ac4b392db8 | |||
| c3d360fa63 | |||
| 3f199f32ab | |||
|
|
1994d99294 | ||
|
|
cbc62f4903 | ||
| f40a82df57 |
@@ -1,7 +1,7 @@
|
||||
Package: webif
|
||||
Priority: optional
|
||||
Section: web
|
||||
Version: 1.4.8-8
|
||||
Version: 1.4.8-10
|
||||
Architecture: mipsel
|
||||
Maintainer: af123@hpkg.tv
|
||||
Depends: tcpfix,webif-channelicons(>=1.1.27),lighttpd(>=1.4.39-1),jim(>=0.79),jim-pack(>=0.79),jim-oo(>=0.77),jim-sqlite3(>=0.77),jim-cgi(>=0.7-2),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.8),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.13),webif-charts(>=1.2-1),stripts(>=1.4.2),tmenu(>=1.21-2),ffmpeg(>=2.8),id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.98),sqlite3(>=3.15.1),jim-xconv,zip(>=3.0-1),wget
|
||||
|
||||
@@ -90,7 +90,7 @@ switch $action {
|
||||
if {$mode eq "cut"} {
|
||||
catch {file rename $path "$dir/$file"}
|
||||
} else {
|
||||
catch {puts [exec /mod/bin/busybox/cp -r \
|
||||
catch {puts [exec cp -r \
|
||||
$path $dir]}
|
||||
}
|
||||
} elseif {[string match {*.ts} $path]} {
|
||||
|
||||
@@ -9,13 +9,17 @@ httpheader "application/json"
|
||||
set dir [cgi_get dir "/media/My Video"]
|
||||
set dlen [string length "$dir/"]
|
||||
|
||||
proc du {args} {
|
||||
if {[catch {exec du {*}$args}} dutxt]} {
|
||||
set dutxt ""
|
||||
}
|
||||
return $dutxt
|
||||
}
|
||||
|
||||
#9.4G /media/My Video/Archive
|
||||
#1.4G /media/My Video/CSI_ Crime Scene Investigation
|
||||
puts "{"
|
||||
if {[catch {exec /mod/bin/busybox/du -h -l -d 1 "$dir/"} dutxt]} {
|
||||
set dutxt ""
|
||||
}
|
||||
foreach line [split $dutxt "\n"] {
|
||||
foreach line [split [du -h -l -d 1 "$dir/"] "\n"] {
|
||||
lassign [split $line "\t"] size node
|
||||
set node [string range $node $dlen end]
|
||||
if {[string length $node]} {
|
||||
@@ -31,10 +35,7 @@ foreach file [readdir $dir] {
|
||||
if {![string match "/*" $lk]} { set lk "$dir/$lk" }
|
||||
|
||||
if {![file isdirectory $lk]} continue
|
||||
if {[catch {exec /mod/bin/busybox/du -h "$lk"} dutxt]} {
|
||||
set dutxt ""
|
||||
}
|
||||
foreach line [split $dutxt "\n"] {
|
||||
foreach line [split [du -h "$lk"] "\n"] {
|
||||
set fields [split $line "\t"]
|
||||
if {[lindex $fields 1] eq $lk} {
|
||||
set node [file tail $file]
|
||||
@@ -44,11 +45,11 @@ foreach file [readdir $dir] {
|
||||
}
|
||||
}
|
||||
|
||||
if {[catch {exec /mod/bin/busybox/du -hs "$dir/"} dutxt]} {
|
||||
set dutxt [du -hs "$dir/"]
|
||||
if {$dutxt eq ""} {
|
||||
set dutxt "N/A"
|
||||
}
|
||||
lassign [split $dutxt] total
|
||||
puts "\"\": \"$total\""
|
||||
|
||||
puts "}"
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ set rsize 0
|
||||
proc gen {dir ddir {depth 0} {expand 0}} {{i 0}} {
|
||||
global root lroot rsize
|
||||
|
||||
if {[catch {set dsize [exec /mod/bin/busybox/du -s "$dir/"]} msg]} {
|
||||
if {[catch {set dsize [exec du -s "$dir/"]} msg]} {
|
||||
puts "Error, $dir, $msg"
|
||||
return
|
||||
}
|
||||
|
||||
@@ -19,6 +19,19 @@ proc f2c {frequency} {
|
||||
return [expr int($ch)]
|
||||
}
|
||||
|
||||
proc svc2mux {svcid mux} {
|
||||
return [switch $($svcid / 4096) {
|
||||
1 { format "PSB1/BBC A" }
|
||||
2 { format "PSB2/D3&4" }
|
||||
4 { format "PSB3/BBC B" }
|
||||
3 { format "COM4/SDN" }
|
||||
5 { format "COM5/ARQ A" }
|
||||
6 { format "COM6/ARQ B" }
|
||||
10 { format "COM7/ARQ C" }
|
||||
default { format $mux }
|
||||
}]
|
||||
}
|
||||
|
||||
puts "
|
||||
<div class=va>
|
||||
<img class=va src=/img/aerials.png height=50>
|
||||
@@ -61,7 +74,7 @@ foreach tw [$db query {
|
||||
puts "<td>[system strip $netName]</td>"
|
||||
|
||||
set channels [$db query {
|
||||
select usLcn, szSvcName, szPrvName, aucDefaultAuthority
|
||||
select usLcn, szSvcName, usSvcId, szPrvName, aucDefaultAuthority
|
||||
from TBL_SVC left join TBL_PRV using (prvIdx)
|
||||
where tsIdx = %s
|
||||
order by usLcn
|
||||
@@ -72,14 +85,15 @@ foreach tw [$db query {
|
||||
} else {
|
||||
set mux "Unknown"
|
||||
}
|
||||
if {[llength $channels] != 0} {
|
||||
set chan [lindex $channels 0]
|
||||
lassign $chan x lcn x name x svcid
|
||||
set mux [svc2mux $svcid $mux]
|
||||
}
|
||||
set ehs 0
|
||||
foreach chan $channels {
|
||||
lassign $chan x lcn x name
|
||||
set name [system strip $name]
|
||||
lassign $chan x lcn
|
||||
if {$lcn >= 800} { incr ehs }
|
||||
if {[dict exists $::muxdb $name]} {
|
||||
set mux $::muxdb($name)
|
||||
}
|
||||
}
|
||||
puts "<td>$mux</td>"
|
||||
if {$eSystem == 0} {
|
||||
@@ -106,7 +120,7 @@ foreach tw [$db query {
|
||||
</tr>"
|
||||
altrow reset
|
||||
foreach chan $channels {
|
||||
lassign $chan x lcn x name x prv x auth
|
||||
lassign $chan x lcn x name x svcid x prv x auth
|
||||
set name [system strip $name]
|
||||
set prv [system strip $prv]
|
||||
altrow
|
||||
|
||||
|
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 618 B |
@@ -115,8 +115,8 @@ proc ::auto::dumpq {qq} {
|
||||
if {[$q get action] in $::auto::plugins} {
|
||||
set pri $::auto::plugins([$q get action])
|
||||
}
|
||||
log [format " C: %4d %5d %8s - [$q get file]" \
|
||||
[$q get id] $pri [$q get action]] 2
|
||||
log [format " C: %4d %5d %8s - %s" \
|
||||
[$q get id] $pri [$q get action] [$q get file]] 2
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,10 @@ if {!$::auto::force} {
|
||||
|
||||
set timesincelast $(([clock seconds] - [$::auto::settings autolast]) \
|
||||
/ 60)
|
||||
if {$timesincelast < $autofreq} {
|
||||
if {$timesincelast < 0} {
|
||||
# time machine issue: correct it
|
||||
$::auto::settings autolast 0
|
||||
} elseif {$timesincelast < $autofreq} {
|
||||
::auto::log "Aborting, not yet time to run." 2
|
||||
::auto::log " elapsed (minutes): $timesincelast (<$autofreq)" 2
|
||||
exit
|
||||
|
||||
@@ -5,12 +5,13 @@ set ::auto::logprefix ""
|
||||
set ::auto::loglevel 1
|
||||
|
||||
proc ::auto::loginit {} {
|
||||
|
||||
variable settings
|
||||
set logsize [$settings logsize]
|
||||
# Rotate log file if large enough.
|
||||
if {[file exists $::auto::logfile] &&
|
||||
[file size $::auto::logfile] > 2097152} {
|
||||
file copy -force $::auto::logfile "/mod/tmp/auto_old.log"
|
||||
file delete $::auto::logfile
|
||||
[file size $::auto::logfile] > $logsize} {
|
||||
set tstamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}]
|
||||
file rename -force $::auto::logfile "/mod/tmp/auto.$tstamp.log"
|
||||
}
|
||||
|
||||
# Open log file
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
#exec >>/tmp/reboot.log 2>&1
|
||||
|
||||
if [ "$1" = "-f" -a "$0" != "/tmp/fastreboot" ]; then
|
||||
cp $0 /tmp/fastreboot
|
||||
cp "$0" /tmp/fastreboot
|
||||
chmod 755 /tmp/fastreboot
|
||||
exec /tmp/fastreboot -f
|
||||
|
||||
exit 0
|
||||
fi
|
||||
|
||||
model="`cat /etc/model`"
|
||||
model=$(cat /etc/model)
|
||||
|
||||
feedback()
|
||||
{
|
||||
[ -x /mod/bin/hwctl ] && /mod/bin/hwctl 13 0 >> /dev/null 2>&1
|
||||
[ "$model" = HDR ] && display "$1" || display "\$$2"
|
||||
if [ "$model" = HDR ]; then display "$1"; else display "\$$2"; fi
|
||||
}
|
||||
|
||||
readwakeup()
|
||||
@@ -23,7 +23,7 @@ readwakeup()
|
||||
# Read the wakeup timer from the front panel
|
||||
tries=10
|
||||
while [ $tries -gt 0 ]; do
|
||||
wakeup="`/mod/bin/hwctl d`"
|
||||
wakeup=$(/mod/bin/hwctl d)
|
||||
[ -n "$wakeup" ] && break
|
||||
tries=$((tries - 1))
|
||||
sleep 1
|
||||
@@ -37,7 +37,7 @@ setwakeup()
|
||||
tries=10
|
||||
while [ $tries -gt 0 ]; do
|
||||
echo "Setting wakeup timer..."
|
||||
/mod/bin/hwctl 5 1 ^`date +%s` >/dev/null
|
||||
/mod/bin/hwctl 5 1 "^$(date +%s)" >/dev/null
|
||||
tries=$((tries - 1))
|
||||
if readwakeup | grep "00 00 00 00"; then
|
||||
sleep 1
|
||||
@@ -50,7 +50,7 @@ setwakeup()
|
||||
|
||||
lbr=0
|
||||
if [ -f /tmp/.lbr ]; then
|
||||
lbr="`cat /tmp/.lbr`"
|
||||
lbr=$(cat /tmp/.lbr)
|
||||
#echo "LBR: $lbr"
|
||||
else
|
||||
# No last-boot-reason file, fall-back to reading timer directly.
|
||||
@@ -87,12 +87,28 @@ fi
|
||||
feedback "Fast Reboot" "FRBT"
|
||||
|
||||
# Stop mod services
|
||||
for f in `ls -1r /mod/etc/init.d/S??*`; do
|
||||
[ -f "$f" -a -x "$f" ] || continue
|
||||
# Don't stop the SSH server
|
||||
echo $f | grep -q dropbear && continue
|
||||
$f stop
|
||||
done
|
||||
ls -1r /mod/etc/init.d/S??* |
|
||||
while read -r f; do
|
||||
[ -f "$f" ] || continue
|
||||
case $f in
|
||||
*.sh)
|
||||
# actually no such scripts
|
||||
continue
|
||||
(
|
||||
trap - INT QUIT TSTP
|
||||
set -- stop
|
||||
# might not use $1 ?
|
||||
. "$f"
|
||||
)
|
||||
;;
|
||||
*)
|
||||
# Don't stop the SSH server
|
||||
echo "$f" | grep -q dropbear && continue
|
||||
[ -x "$f" ] && "$f" stop
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
# Stop Humax App
|
||||
/etc/init.d/S90settop shut
|
||||
@@ -107,11 +123,16 @@ killall udhcpc
|
||||
|
||||
# Unmount disks
|
||||
/bin/sync
|
||||
mount | grep '^/dev/sd' | awk '{print $1}' | xargs umount -l
|
||||
mount | grep '^/dev/sd' |
|
||||
{ lastdev=
|
||||
while read -r dev _; do
|
||||
[ "${lastdev:-}" = "$dev" ] && continue
|
||||
umount -l "$dev"; lastdev=$dev
|
||||
done; }
|
||||
|
||||
# Stop device
|
||||
for f in /sys/block/sd?; do
|
||||
echo 1 >> $f/device/delete
|
||||
echo 1 >> "$f/device/delete"
|
||||
done
|
||||
|
||||
feedback "START SYSTEM" "boot"
|
||||
|
||||
@@ -967,19 +967,29 @@ proc {rsv construct} {event type} {
|
||||
set args(szFPBRecPath) "$args(szevtname)"
|
||||
set events {}
|
||||
set seen {}
|
||||
set now [clock seconds]
|
||||
set progs [lmap i [\
|
||||
epg dbfetch dump -scrid [$event get series_crid] \
|
||||
-sort start] {
|
||||
if {[set ecrid [$i get event_crid]] eq ""} continue
|
||||
if {$ecrid in $seen} continue
|
||||
lappend seen $ecrid
|
||||
if {[$i get start] < [$event get start]} {
|
||||
|
||||
if {[$i end] < $now} {
|
||||
set args(usLastRecordedEvtId) [$i get event_id]
|
||||
continue
|
||||
}
|
||||
if {$ecrid in $seen} continue
|
||||
lappend seen $ecrid
|
||||
lappend events [rsv mkaul $i]
|
||||
list "1$::ccrid$ecrid"
|
||||
}]
|
||||
# set 1st event to record
|
||||
binary scan [string range [lindex $events 0] 0 15] \
|
||||
iiii service_id start end event_id
|
||||
#puts "$service_id $start [clock format $end] $event_id"
|
||||
set args(hsvc) $service_id
|
||||
set args(nsttime) $start
|
||||
set args(usevtid) $event_id
|
||||
set args(nduration) $($end-$start)
|
||||
set args(szEventToRecord) "[join $progs "|"]|"
|
||||
set args(aulEventToRecordInfo) [join $events ""]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user