#!/usr/bin/php-cgi -q
<?php

require_once(dirname(__FILE__).'/../lib/controller/rad/class.RADMaint.inc.php');

$obj = new RADMaint();
if (is_object($obj)) {
    if ( $obj->freq()) {
	if ( $obj->check()) {
	    if ( $obj->parse_freerad_log()) {
		exit(0);
	    } else {
		echo('Error! Can not parse FREERADIUS log file!');
		exit(1);
	    }
	} else {
	    echo('Error! Can not check, if FREERADIUS works!');
	    exit(1);
	}
    } else {
	echo('Error! Can not do frequently maintenance!');
	exit(1);
    }
} else {
    echo('Error! Can not instantiate class!');
    exit(1);
}

?>