Page MenuHomeDevCentral
Paste P157

hello.cgi
ActivePublic

Authored by dereckson on Feb 10 2016, 03:04.
Tags
None
Referenced Files
F19269: hello.cgi
Feb 10 2016, 03:05
F19268: hello.cgi
Feb 10 2016, 03:04
Subscribers
None
#!/bin/sh
# -------------------------------------------------------------
# HTTP request headers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo "Content-type: text/html; charset=UTF-8"
echo ""
# -------------------------------------------------------------
# Header
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo '<!doctype html><html>'
echo '<head>'
echo ' <meta charset="utf-8" />'
echo ' <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/foundation/5.3.0/css/foundation.min.css" type="text/css" />'
echo '</head>'
echo '<body>'
echo ' <div class="row">'
echo ' <h1>Fortune and status</h1>'
echo ' </div>'
# -------------------------------------------------------------
# Content
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo ' <div class="row">'
echo ' <div class="large-8 columns">'
echo ' <h2>Fortune</h2><pre>'
/usr/games/fortune
echo ' </pre></div>'
echo ' <div class="large-4 columns">'
echo ' <h2>Status</h2>'
echo ' <h3>Server</h3>'
hostname
echo ' <h3>Uptime</h3>'
uptime
echo ' <h3>Kernel information</h3>'
uname -a
echo ' </div>'
echo ' </div>'
# -------------------------------------------------------------
# Footer
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo '<hr>'
echo 'Hello world from sh!'
echo '</body>'
echo '</html>'

Event Timeline

dereckson changed the title of this paste from untitled to hello.cgi.