forked from hummypkg/webif
36 lines
739 B
Plaintext
36 lines
739 B
Plaintext
|
#!/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>"
|
||
|
|