#!/bin/sh

echo "Content-Type: text/html"
echo
echo "<html>"
echo "<head>"
echo "<title>List of Available Reports for AWStats</title>"
echo "</head>"
echo "<body>"
echo "<h1>List of Available Reports for AWStats</h1>"
echo "<ul>"
for config in /etc/awstats/awstats.*.conf; do
    config=${config#/etc/awstats/awstats.} # remove prefix
    config=${config%.conf}                 # remove suffix
    if [ "$config" = "model" ]; then
	continue
    fi
    echo "<li><a href='awstats.pl?config=$config'>$config</a></li>"
done
echo "</ul>"
echo "</body>"
echo "</html>"
