diff --git a/CONTROL/control b/CONTROL/control index 27cfaca..146be0c 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 0.7.5 +Version: 0.7.5-1 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.5),hmt(>=1.0.6),ssmtp diff --git a/var/mongoose/cgi-bin/opkg.jim b/var/mongoose/cgi-bin/opkg.jim index 366581b..4fd4edb 100755 --- a/var/mongoose/cgi-bin/opkg.jim +++ b/var/mongoose/cgi-bin/opkg.jim @@ -9,17 +9,23 @@ cgi_input set cmd [cgi_get cmd update] +proc opkg {cmd} { + chunk ">>> opkg $cmd\r\n" + set bcmd "|/mod/var/mongoose/lib/opkg $cmd" + set fd [open $bcmd r] + while {[gets $fd line] >= 0} { + chunk "$line\r\n" + #chunk_pad + } + close $fd +} + start_chunked -set bcmd "|/mod/var/mongoose/lib/opkg $cmd" -set fd [open $bcmd r] -while {[gets $fd line] >= 0} { - chunk "$line\r\n" - #chunk_pad -} -close $fd +if {$cmd eq "upgrade"} { opkg update } +opkg $cmd -if {$cmd eq "update"} { +if {$cmd eq "update" || $cmd eq "upgrade"} { chunk "Updating package meta information\r\n" pkg fetchmeta chunk "Done.\r\n" diff --git a/var/mongoose/include/services.jim b/var/mongoose/include/services.jim index 97c73bc..68d21b8 100755 --- a/var/mongoose/include/services.jim +++ b/var/mongoose/include/services.jim @@ -3,11 +3,7 @@ set services [split [exec /mod/bin/service mlist]] foreach service $services { - set data [split $service ":"] - set name [lindex $data 0] - set installed [lindex $data 1] - set auto [lindex $data 2] - set running [lindex $data 3] + lassign [split $service ":"] name installed auto running puts "$name" if (!$installed) {