2011-06-28 00:20:31 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2011-07-11 23:29:21 +00:00
|
|
|
source /mod/var/mongoose/lib/setup
|
2011-07-14 22:22:54 +00:00
|
|
|
require pkg.class chunked
|
2011-06-28 00:20:31 +00:00
|
|
|
|
|
|
|
cgi_input
|
|
|
|
#cgi_dump
|
|
|
|
|
2011-07-14 22:22:54 +00:00
|
|
|
set cmd [cgi_get cmd update]
|
2011-06-28 00:20:31 +00:00
|
|
|
|
2011-07-15 23:20:57 +00:00
|
|
|
start_chunked
|
|
|
|
|
2011-07-11 23:29:21 +00:00
|
|
|
set bcmd "|/mod/var/mongoose/lib/opkg $cmd"
|
|
|
|
set fd [open $bcmd r]
|
|
|
|
while {[gets $fd line] >= 0} {
|
|
|
|
chunk "$line\r\n"
|
2011-07-15 23:20:57 +00:00
|
|
|
#chunk_pad
|
2011-07-11 23:29:21 +00:00
|
|
|
}
|
|
|
|
close $fd
|
|
|
|
|
|
|
|
if {$cmd eq "update"} {
|
|
|
|
chunk "Updating package meta information\r\n"
|
|
|
|
pkg fetchmeta
|
|
|
|
chunk "Done.\r\n"
|
|
|
|
}
|
|
|
|
|
2011-07-15 23:20:57 +00:00
|
|
|
end_chunked
|
2011-06-28 00:20:31 +00:00
|
|
|
|