summaryrefslogtreecommitdiff
path: root/web/src/cgi.tcl-1.10/example/version.cgi
blob: b266acfbf0c347b654151309a3bc10ca721e3564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/depot/path/tclsh

# This is a CGI script that displays some version information that I
# find useful for debugging.

set v [package require cgi]

proc row {var val} {
    table_row {
	td $var
	td $val
    }
}

cgi_eval {
    source example.tcl

    title "Version info"

    cgi_body {
	table border=2 {
	    row "cgi.tcl" $v
	    row "Tcl" [info patchlevel]
	    row "uname -a" [exec uname -a]
	    catch {row "SERVER_SOFTWARE" $env(SERVER_SOFTWARE)}
	    catch {row "HTTP_USER_AGENT" $env(HTTP_USER_AGENT)}
	    catch {row "SERVER_PROTOCOL" $env(SERVER_PROTOCOL)}
	}
    }
}