From 9a72e40c03ec56779ea04e2c5dfaf6fde973f6a6 Mon Sep 17 00:00:00 2001 From: hummypkg Date: Mon, 26 Sep 2011 20:31:17 +0000 Subject: [PATCH] improve system busy detection git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@424 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 2 +- var/mongoose/lib/system.class | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index bea675b0..517de2da 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 0.7.1-3 +Version: 0.7.1-4 Architecture: mipsel Maintainer: af123@hummypkg.org.uk Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.3),hmt(>=1.0.6),ssmtp diff --git a/var/mongoose/lib/system.class b/var/mongoose/lib/system.class index 2ea87b4e..21b5f117 100644 --- a/var/mongoose/lib/system.class +++ b/var/mongoose/lib/system.class @@ -60,11 +60,12 @@ proc {system diskspace} {} { } proc {system busy} {} { - # Is humaxtv doing anything? + # Is humaxtv doing anything important? set pid [exec /mod/bin/busybox/pgrep humaxtv] set c 0 - catch { set c [exec /mod/bin/lsof -p $pid | grep Video | fgrep .ts | wc -l] } - + foreach line [split [exec /mod/bin/lsof -p $pid] "\n"] { + if {[string match {*Video*.ts} $line]} { incr c } + } if {$c > 0} { return 1 } return 0 }