mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 09:04:39 +00:00
cron: prepend system_, but move to system.inc later
This commit is contained in:
parent
a711740da7
commit
f16199ffe9
@ -2184,12 +2184,31 @@ EOD;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function configure_cron()
|
||||
function system_configure_cron($verbose = false)
|
||||
{
|
||||
global $config;
|
||||
|
||||
function generate_cron_job($command, $minute = '0', $hour = '*', $monthday = '*', $month = '*', $weekday = '*')
|
||||
{
|
||||
$cron_item = array();
|
||||
|
||||
$cron_item['minute'] = $minute;
|
||||
$cron_item['hour'] = $hour;
|
||||
$cron_item['mday'] = $monthday;
|
||||
$cron_item['month'] = $month;
|
||||
$cron_item['wday'] = $weekday;
|
||||
$cron_item['command'] = $command;
|
||||
|
||||
return $cron_item;
|
||||
}
|
||||
|
||||
$autocron = array();
|
||||
|
||||
if ($verbose) {
|
||||
echo 'Configuring CRON...';
|
||||
flush();
|
||||
}
|
||||
|
||||
/* hourly */
|
||||
$autocron[] = generate_cron_job('/usr/local/sbin/expiretable -v -t 3600 webConfiguratorlockout', '1');
|
||||
$autocron[] = generate_cron_job('/usr/local/sbin/expiretable -v -t 3600 sshlockout', '2');
|
||||
@ -2260,20 +2279,10 @@ function configure_cron()
|
||||
|
||||
file_put_contents('/var/cron/tabs/root', $crontab_contents);
|
||||
killbypid('/var/run/cron.pid', 'HUP');
|
||||
}
|
||||
|
||||
function generate_cron_job($command, $minute = '0', $hour = '*', $monthday = '*', $month = '*', $weekday = '*')
|
||||
{
|
||||
$cron_item = array();
|
||||
|
||||
$cron_item['minute'] = $minute;
|
||||
$cron_item['hour'] = $hour;
|
||||
$cron_item['mday'] = $monthday;
|
||||
$cron_item['month'] = $month;
|
||||
$cron_item['wday'] = $weekday;
|
||||
$cron_item['command'] = $command;
|
||||
|
||||
return $cron_item;
|
||||
if ($verbose) {
|
||||
echo "done.\n";
|
||||
}
|
||||
}
|
||||
|
||||
function is_apinger_enabled()
|
||||
|
||||
@ -174,11 +174,7 @@ mwexec("/usr/local/etc/rc.sshd");
|
||||
/* start web server */
|
||||
echo 'Starting webConfigurator...'. (system_webgui_configure() ? "done.\n" : "failed.\n");
|
||||
|
||||
/* configure cron service */
|
||||
echo "Configuring CRON...";
|
||||
configure_cron();
|
||||
echo "done.\n";
|
||||
|
||||
system_configure_cron(true);
|
||||
system_routing_configure();
|
||||
system_routing_enable();
|
||||
services_dnsmasq_configure(true);
|
||||
|
||||
@ -53,7 +53,7 @@ system_resolvconf_generate();
|
||||
system_routing_enable();
|
||||
interfaces_configure();
|
||||
services_dyndns_configure();
|
||||
configure_cron();
|
||||
system_configure_cron();
|
||||
system_ntp_configure();
|
||||
mwexec_bg('/usr/local/etc/rc.sshd');
|
||||
mwexec_bg('/usr/local/etc/rc.restart_webgui');
|
||||
|
||||
@ -449,7 +449,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$savemsg = gettext("Google Drive backup settings have been saved.");
|
||||
|
||||
write_config();
|
||||
configure_cron();
|
||||
system_configure_cron();
|
||||
|
||||
try {
|
||||
$filesInBackup = backup_to_google_drive();
|
||||
|
||||
@ -451,7 +451,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
}
|
||||
// sort filter items per interface, not really necessary but leaves a bit nicer sorted config.xml behind.
|
||||
filter_rules_sort();
|
||||
configure_cron();
|
||||
system_onfigure_cron();
|
||||
// write to config
|
||||
write_config();
|
||||
mark_subsystem_dirty('filter');
|
||||
|
||||
@ -208,7 +208,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
|
||||
$savemsg = get_std_save_message();
|
||||
|
||||
configure_cron();
|
||||
system_configure_cron();
|
||||
filter_configure();
|
||||
}
|
||||
}
|
||||
|
||||
@ -168,7 +168,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$savemsg = get_std_save_message();
|
||||
|
||||
system_resolvconf_generate(true);
|
||||
configure_cron();
|
||||
system_configure_cron();
|
||||
activate_powerd();
|
||||
load_crypto_module();
|
||||
load_thermal_module();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user