webif/var/mongoose/include/status.jim
hummypkg d3e7adfd1f check in initial web interface
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif@161 2a923420-c742-0410-a762-8d5b09965624
2011-06-07 13:26:45 +00:00

36 lines
739 B
Plaintext
Executable File

#!/mod/bin/jimsh
set ::env(PATH) "/mod/bin/busybox:/mod/bin:/bin"
set pid [exec pgrep humaxtv]
if {[catch {set line [exec lsof -p $pid | grep Video | fgrep .ts]} ]} {
exit
}
regsub -all -- {[[:space:]]+} $line " " line
set fields [split $line " "]
set size [lindex $fields 6]
sleep 2
set line [exec lsof -p $pid | grep Video | fgrep .ts]
regsub -all -- {[[:space:]]+} $line " " line
set fields [split $line " "]
set size2 [lindex $fields 6]
if { $size2 > $size } {
set mode "Recording"
set icon "745_1_11_Video_1REC.png"
} else {
set mode "Watching"
set icon "745_1_10_Video_2Live.png"
}
set name [lindex [split $line "/"] end]
puts "<div class=shadowbox><div>"
puts "<img src=/images/$icon>$mode $name"
puts "</div></div>"