Example #1
0
if ($argv[1] == "--reconfigure") {
    $EXEC_PID_FILE = "/etc/artica-postfix/" . basename(__FILE__) . ".reconfigure.pid";
    $unix = new unix();
    $sock = new sockets();
    $pid = @file_get_contents($EXEC_PID_FILE);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        $timefile = $unix->file_time_min($EXEC_PID_FILE);
        if ($timefile < 15) {
            print "Starting......: " . date("H:i:s") . " Checking (L." . __LINE__ . ") squid Already executed pid {$pid} {$timefile}Mn...\n";
            die;
        }
    }
    squid_reconfigure_build_tool();
    $EnableTransparent27 = intval($sock->GET_INFO("EnableTransparent27"));
    $q = new mysql_squid_builder();
    Defaultschedules(true);
    @file_put_contents($EXEC_PID_FILE, posix_getpid());
    ApplyConfig();
    BuildCaches(true);
    certificate_generate();
    echo "Starting......: " . date("H:i:s") . " Check files and security...\n";
    CheckFilesAndSecurity();
    echo "Starting......: " . date("H:i:s") . " Reloading SQUID...\n";
    Reload_Squid();
    build_sslpasswords();
    writeinitd();
    shell_exec("/etc/init.d/squid reload");
    if ($EnableTransparent27 == 1) {
        shell_exec("/etc/init.d/squid-nat reload");
    }
    writelogs("reload Dansguardian (if enabled)", __FUNCTION__, __FILE__, __LINE__);
Example #2
0
    die;
}
if ($argv[1] == "--cache-rules") {
    cache_rules();
    die;
}
if ($argv[1] == "--band") {
    bandwith_rules();
    die;
}
if ($argv[1] == "--cert") {
    BuildSquidCertificate();
    die;
}
if ($argv[1] == "--defaults-schedules") {
    Defaultschedules();
    die;
}
if ($argv[1] == "--reconfigure") {
    $argv[1] = "--build";
}
if ($argv[1] == "--build") {
    build();
    exit;
}
writelogs("Unable to understand:`" . @implode(" ", $argv) . "`", "MAIN", __FILE__, __LINE__);
// $EnableRemoteStatisticsAppliance -> Le proxy est un client.
// $EnableWebProxyStatsAppliance -> Le serveur est un serveur de statistiques.
function CheckSettingsInc()
{
    $unix = new unix();