Page MenuHomeDevCentral

hello.cgi

Authored By
dereckson
Feb 10 2016, 03:04
Size
1 KB
Referenced Files
None
Subscribers
None

hello.cgi

#!/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>Server</h2>'
hostname
echo ' <h2>Uptime</h2>'
uptime
echo ' <h2>Kernel information</h2>'
uname -a
echo ' </div>'
echo ' </div>'
# -------------------------------------------------------------
# Footer
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
echo '<hr>'
echo 'Hello world from sh!'
echo '</body>'
echo '</html>'

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17132
Default Alt Text
hello.cgi (1 KB)

Event Timeline