What's in the SUNRUP.CGI file?
The sunrup.cgi file actually contains a shell script which
is run whenever the URL is called.
Some things worth mentioning,
- the < and > symbols must be quoted using the \ character to keep them from being interpreted by the unix shell
- the 2nd line echos out the content type (in this case, text/html)
- the 3rd line echos a blank line (which separates the headers,
like content-type, from the body of the file (in this case the output
from the shell script commands.
- the actual shell script only does two things, runs the
/usr/bin/rup -l command, and pipes the output through my sunrup program.
sunrup.cgi:
#!/bin/sh
echo Content-type: text/html
echo
echo \<body bgcolor=\"\#ffffff\"\>
echo \<b\>Please wait while I gather the current status of the Sun lab...\<br\>
echo \<pre\>
/usr/bin/rup -l | /home/staff/erik/public_html/sunlab/sunrup
[Back]