示例#1
0
ini_set('error_prepend_string', null);
ini_set('error_append_string', null);
$GLOBALS["TITLENAME"] = "Firewall configurator";
if ($argv[1] == "--build") {
    $GLOBALS["OUTPUT"] = true;
    build();
    exit;
}
if ($argv[1] == "--restart") {
    $GLOBALS["OUTPUT"] = true;
    restart();
    exit;
}
if ($argv[1] == "--hourly") {
    $GLOBALS["OUTPUT"] = true;
    hourly();
    exit;
}
function build()
{
    if ($GLOBALS["OUTPUT"]) {
        echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, building configuration.\n";
    }
    @mkdir("/var/lib/shorewall", 0755, true);
    $unix = new unix();
    if (!isset($GLOBALS["INTERFACES"])) {
        $GLOBALS["INTERFACES"] = $unix->NETWORK_ALL_INTERFACES();
    }
    shorewall_conf();
    build_providers();
    build_zones();
示例#2
0
文件: cron.php 项目: Elwell/concerto
include CONTENT_DIR . 'render/render.php';
//Functions to generate the cache
if (date("D Hi") == 'Sun 0010' || $_REQUEST['weekly']) {
    weekly();
    print "Finished weekly job\n";
}
if (date("Hi") == '0010' || $_REQUEST['nightly']) {
    nightly();
    print "Finished nightly job\n";
}
if (date("i") == '10' || $_REQUEST['hourly']) {
    //In the event screen rotation isn't enabled in the config...
    if (!is_array($screen_rotate)) {
        $screen_rotate = false;
    }
    hourly($screen_rotate);
    print "Finished hourly job";
}
always();
function weekly()
{
    echo "Clearing cache directories.\n";
    clear_cache(IMAGE_DIR . '/cache/');
    clear_cache(TEMPLATE_DIR . '/cache/');
    echo "Cache cleared.\n";
}
function nightly()
{
    //Rollover the feed-content table's statistics
    echo "Rolling over statistics...\n";
    $sql = "UPDATE `feed_content` SET `yesterday_count` = `display_count`";