From 987425b22af490de9c2a32133cc4eab73bafdcee Mon Sep 17 00:00:00 2001 From: hummypkg Date: Wed, 8 Oct 2014 00:25:31 +0000 Subject: [PATCH] change connectivity test git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@2047 2a923420-c742-0410-a762-8d5b09965624 --- CONTROL/control | 4 ++-- webif/lib/system.class | 15 +++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index 8ef22be..4760571 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,10 +1,10 @@ Package: webif Priority: optional Section: web -Version: 1.0.17 +Version: 1.0.17-1 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif-channelicons(>=1.1.13),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(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),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),mongoose +Depends: webif-channelicons(>=1.1.13),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(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),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),mongoose Suggests: Description: An evolving web interface for the Humax. Tags: http://hummy.tv/forum/threads/5031/ diff --git a/webif/lib/system.class b/webif/lib/system.class index 20b6309..637cd1e 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -375,11 +375,18 @@ proc {system filename} {str {extra ""}} { return [regsub -all "\[$chars]" $str "_"] } -proc {system connectivity} {{site "hpkg.tv"}} { - if {[catch {exec /bin/ping -4 -c 2 -W 3 -w 3 -q $site >/dev/null}]} { - return 0 +proc {system connectivity} {{site "hpkg.tv"} {port 80} {ret "0"}} { + set extra [lassign [exec /mod/bin/tcpping $site $port] result] + if {$ret ne "0"} { upvar $ret err } + switch $result { + OK { return 1 } + default { + set err [list $result $extra] + return 0 + } } - return 1 + set err UNKNOWN + return 0 } proc {system strip} {str} {