2011-11-12 23:57:19 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2011-11-12 23:57:19 +00:00
|
|
|
require system.class chunked
|
|
|
|
|
|
|
|
cgi_input
|
|
|
|
#cgi_dump
|
|
|
|
|
|
|
|
set diag [cgi_get diag general]
|
|
|
|
|
|
|
|
start_chunked
|
|
|
|
|
|
|
|
if {[system modversion 1] < 113} {
|
|
|
|
chunk ">>> Diagnostics only available with customised firmware 1.13 or above."
|
|
|
|
end_chunked
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
chunk ">>> Beginning diagnostic $diag\r\n"
|
|
|
|
|
|
|
|
set bcmd "|/bin/diag $diag"
|
|
|
|
set fd [open $bcmd r]
|
|
|
|
while {[gets $fd line] >= 0} {
|
|
|
|
chunk "$line\r\n"
|
|
|
|
#chunk_pad
|
|
|
|
}
|
|
|
|
close $fd
|
|
|
|
chunk "\r\n"
|
|
|
|
chunk ">>> Ending diagnostic $diag\r\n"
|
|
|
|
|
|
|
|
end_chunked
|
|
|
|
|