#! /bin/sh
#
# radiusd	Cron script to rotate radiusd log files daily.
#		Debian/Linux: place this in /etc/cron.daily.
#

umask 027
cd /var/log

# Take care of the standard logfiles.
cd /var/log
if [ -f radius.log ]
then
	savelog -g adm -m 640 -c 3 radius.log > /dev/null
fi

# Rotate "details" files.
if [ ! -d radacct/. ]
then
	exit 0
fi
cd radacct

for LOG in detail */detail
do
	if [ -f $LOG ]
	then
		savelog -g adm -m 640 -u root -c 3 $LOG >/dev/null
	fi
done

