#! /bin/sh
#
# radwatch	Script to watch RADIUS and restart if it died.
#

MAILTO=root@mydomain.nl

exec >> /var/log/radwatch.log 2>&1

cd /var/log/radacct
ulimit -c unlimited

while :
do
	/usr/local/sbin/in.radiusd -f $*
	echo "`date`: radius died, restarting."
	date | mail $MAILTO -s "radius died, restarted"
	sleep 2
done &

sleep 1

