<?php chdir(dirname(__FILE__) . '/../'); include_once "./config.php"; include_once "./lib/loader.php"; include_once "./lib/threads.php"; set_time_limit(0); // connecting to database $db = new mysql(DB_HOST, '', DB_USER, DB_PASSWORD, DB_NAME); include_once "./load_settings.php"; include_once DIR_MODULES . "control_modules/control_modules.class.php"; $ctl = new control_modules(); if (defined('ONEWIRE_SERVER')) { include_once DIR_MODULES . 'onewire/onewire.class.php'; $onw = new onewire(); } else { exit; } while (1) { echo date("H:i:s") . " running " . basename(__FILE__) . "\n"; setGlobal(str_replace('.php', '', basename(__FILE__)) . 'Run', time()); // check all 1wire devices $onw->updateDevices(); $onw->updateDisplays(); if (file_exists('./reboot') || $_GET['onetime']) { $db->Disconnect(); exit; } sleep(1); } DebMes("Unexpected close of cycle: " . basename(__FILE__));
//updating RSS channels $to_update=SQLSelect("SELECT ID, TITLE FROM rss_channels WHERE NEXT_UPDATE<=NOW() LIMIT 1"); $total=count($to_update); for($i=0;$i<$total;$i++) { $rss_ch->updateChannel($to_update[$i]['ID']); } $pinghosts->checkAllHosts(1); // checking all hosts $webvars->checkAllVars(); // check all web vars $watchfolders->checkAllFolders(); // checking all watching folders if (defined('ONEWIRE_SERVER')) { $onw->updateStarred(); // check starred 1wire properties $onw->updateDevices(); // check all 1wire devices } if (file_exists('./reboot') || ((time()-$start_time)>7*24*60*60)) { $db->Disconnect(); @unlink('./reboot'); sleep(5); exit; } sleep(1); // 1 second sleep } $db->Disconnect(); // closing database connection