Last change
on this file since 1200 was
1200,
checked in by quentin, 15 years ago
|
HTTP-based list of scripts servers on http://scripts.mit.edu:78/
|
-
Property svn:executable set to
*
|
File size:
637 bytes
|
Rev | Line | |
---|
[1200] | 1 | #!/bin/bash |
---|
| 2 | |
---|
| 3 | # Read and ignore the request |
---|
| 4 | line=foo |
---|
| 5 | while [ -n "$line" ]; do |
---|
| 6 | read line |
---|
| 7 | line=${line%[:blank:]} |
---|
| 8 | line=${line% |
---|
| 9 | } |
---|
| 10 | done |
---|
| 11 | |
---|
| 12 | # Generate an HTTP reply |
---|
| 13 | |
---|
| 14 | echo "HTTP/1.0 200 OK |
---|
| 15 | " |
---|
| 16 | echo "Content-type: text/html |
---|
| 17 | " |
---|
| 18 | echo " |
---|
| 19 | " |
---|
| 20 | echo "<html><head><title>scripts.mit.edu server status</title></head><body><h1>scripts.mit.edu server status</h1><p>The following table shows a list of the servers that are currently handling web requests for scripts.mit.edu:</p><table>" |
---|
| 21 | /sbin/ipvsadm -L -f 2 | sed 's/:0//; s/:Port//' | awk 'BEGIN { OFS="</td><td>" } /->/ { print "<tr><td>" $2, $4, $5, $6 "</td></tr>"}' |
---|
| 22 | echo "</table></body></html>" |
---|
Note: See
TracBrowser
for help on using the repository browser.