17ba0bb00e
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1837 2a923420-c742-0410-a762-8d5b09965624
37 lines
614 B
Plaintext
Executable File
37 lines
614 B
Plaintext
Executable File
#!/mod/bin/jimsh
|
|
|
|
package require cgi
|
|
source /mod/webif/lib/setup
|
|
require pkg.class
|
|
|
|
cgi_input
|
|
#cgi_dump
|
|
|
|
set cmd [cgi_get cmd update]
|
|
|
|
proc opkg {cmd} {
|
|
puts ">>> opkg $cmd\r\n"
|
|
set bcmd "|/mod/webif/lib/bin/opkg $cmd"
|
|
set fd [open $bcmd r]
|
|
while {[gets $fd line] >= 0} {
|
|
puts "$line\r\n"
|
|
}
|
|
close $fd
|
|
puts "\r\n"
|
|
}
|
|
|
|
httpheader "text/plain"
|
|
|
|
if {$cmd eq "upgrade"} { opkg update }
|
|
opkg $cmd
|
|
|
|
if {$cmd eq "update" || $cmd eq "upgrade"} {
|
|
puts "Updating package meta information\r\n"
|
|
pkg fetchmeta
|
|
puts "Done.\r\n"
|
|
puts "Updating diagnostic meta information\r\n"
|
|
pkg fetchdiagmeta
|
|
puts "Done.\r\n"
|
|
}
|
|
|