#! /bin/sh
#
# cron script to perform monthly login accounting.
#
# Written by Ian A. Murdock <imurdock@gnu.ai.mit.edu>
# Modified by Dirk Eddelbuettel <edd@debian.org>   

if [ -x /usr/sbin/accton ]
then
    echo "Login accounting for the month ended `date`:" > /var/log/wtmp.report
    echo >> /var/log/wtmp.report
    ac -p | sort -nr +1 >> /var/log/wtmp.report
    echo >> /var/log/wtmp.report
    last >> /var/log/wtmp.report
fi
