Example #1
0
function Entry()
{
    $dao = new Dao();
    ScanRules($dao);
    SendMails($dao);
}
Example #2
0
include_once dirname(__FILE__) . '/framework/frame.class.inc';
include_once dirname(__FILE__) . '/framework/class.settings.inc';
$EnableSquidQuotasBandwidth = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableSquidQuotasBandwidth"));
$InfluxUseRemote = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/InfluxUseRemote"));
if ($InfluxUseRemote == 1) {
    $InfluxSyslogRemote = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/InfluxSyslogRemote"));
    if ($InfluxSyslogRemote == 1) {
        $EnableSquidQuotasBandwidth = 0;
    }
}
if ($EnableSquidQuotasBandwidth == 0) {
    echo "Feature is not enabled, aborting...\n";
    build_progress("{disabled}", 110);
    die;
}
ScanRules();
function build_progress($text, $pourc)
{
    $echotext = $text;
    $echotext = str_replace("{reconfigure}", "Reconfigure", $echotext);
    echo "Starting......: " . date("H:i:s") . " {$pourc}% {$echotext}\n";
    $cachefile = "/usr/share/artica-postfix/ressources/logs/squid.quotasband.status.progress";
    $array["POURC"] = $pourc;
    $array["TEXT"] = $text;
    @file_put_contents($cachefile, serialize($array));
    @chmod($cachefile, 0755);
}
function ScanRules()
{
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".pid";