forked from hummypkg/webif
d7284ff3ef
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1016 2a923420-c742-0410-a762-8d5b09965624
34 lines
537 B
Plaintext
Executable File
34 lines
537 B
Plaintext
Executable File
#!/mod/bin/jimsh
|
|
|
|
package require cgi
|
|
source /mod/webif/lib/setup
|
|
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
|
|
|