#!/bin/sh
#
# Make simple web page with summary information.  This should be rewritten
# to use some template system and be more flexible.
#

(
cat <<EOF
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>sitesummary report</title>
</head>
<body>
<h1>sitesummary report</h1>
EOF

for f in site-summary \
    hostclass-summary \
    kernelversion-summary \
    agesinceseen-summary \
    hardware-model-summary \
    debian_edu-summary ; do
    echo "<h2>$f</h2>"
    echo "<pre>"
    /usr/lib/sitesummary/$f
    echo "</pre>"
    echo
done

# Add last updated string
echo "<hr>"
echo -n "<p><b>Last updated</b>: "
date
echo "</p>"

cat <<EOF
</body>
</html>
EOF
) > /var/lib/sitesummary/www/index.html

exit 0
