#!/bin/bash # Simple CGI script # UUID: d0e66064-2bf4-4f53-be5d-03f5de12cf8d echo Content-type: text/plain echo "" LOG_FILE=/var/www/stat/local.log # Show NUM lines if [ -n "$QUERY_STRING" ]; then NUM=$QUERY_STRING else if [ -n "$1" ]; then NUM=$1 else NUM=10 fi fi echo "Current statistic:" tail -n $NUM "$LOG_FILE" | sort -r #-----------------------------------------