diff --git a/CONTROL/control b/CONTROL/control index c4dbab9..e632ca2 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,10 +1,10 @@ Package: webif Priority: optional Section: web -Version: 1.0.16-1 +Version: 1.0.16-2 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif-channelicons(>=1.1.12-1),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.12-2),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 Suggests: Description: An evolving web interface for the Humax. Tags: http://hummy.tv/forum/threads/5031/ diff --git a/webif/cgi-bin/opkg.jim b/webif/cgi-bin/opkg.jim index d889a0e..333c608 100755 --- a/webif/cgi-bin/opkg.jim +++ b/webif/cgi-bin/opkg.jim @@ -2,7 +2,7 @@ package require cgi source /mod/webif/lib/setup -require pkg.class +require pkg.class system.class cgi_input #cgi_dump @@ -22,6 +22,14 @@ proc opkg {cmd} { httpheader "text/plain" +if {![system connectivity]} { + puts "" + puts "!! ERROR - No network connectivity to package repository !!" + puts "" + puts "Check your Internet connection and DNS service and then try again." + exit +} + if {$cmd eq "upgrade"} { opkg update } opkg $cmd diff --git a/webif/lib/system.class b/webif/lib/system.class index 747dd11..e849ce0 100644 --- a/webif/lib/system.class +++ b/webif/lib/system.class @@ -375,3 +375,10 @@ 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 + } + return 1 +} +