3 # radwatch Script to watch RADIUS. Sends mail to root and
4 # restarts radiusd when it dies [which ofcourse
11 exec_prefix=@exec_prefix@
13 localstatedir=@localstatedir@
15 rundir=${localstatedir}/run
18 RADIUSD=$sbindir/radiusd
20 exec >> $logdir/radwatch.log 2>&1
22 # get the path to the radiusd
23 if [ "$1" ] && [ -x "$1" ]
30 [ -d $logdir/radacct ] && cd $logdir/radacct
34 trap 'echo `date`: exit; kill `cat $rundir/radiusd.pid`; exit 0' TERM
39 # Use `wait', otherwise the trap doesn't work.
42 exec >> $logdir/radwatch.log 2>&1
43 echo "`date`: Radius died, restarting.."
44 date | mail -s "Radius died, restarting.." $MAILTO
49 echo "$!" > $rundir/radwatch.pid