git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2451 2a923420-c742-0410-a762-8d5b09965624
26 lines
360 B
Plaintext
Executable File
26 lines
360 B
Plaintext
Executable File
#!/mod/bin/jimsh
|
|
|
|
package require cgi
|
|
source /mod/webif/lib/setup
|
|
require pretty_size
|
|
|
|
cgi_input
|
|
#cgi_dump
|
|
|
|
set file [cgi_get file "/tmp/hosts"]
|
|
if {$file eq "-"} { exit }
|
|
|
|
httpheader "text/plain" 0
|
|
|
|
if {[cgi_get op "-"] eq "x"} {
|
|
exec chmod +x $file
|
|
}
|
|
|
|
if {![file exists $file]} {
|
|
puts 0
|
|
} else {
|
|
set stat [file stat $file]
|
|
puts $($stat(mode) & 0x1ff)
|
|
}
|
|
|