Commit 8ff7c87f authored by Franco Fichtner's avatar Franco Fichtner

cron: expose configure_cron() instead if invoking it multiple times #911

parent 5e97c86d
......@@ -2432,7 +2432,6 @@ function install_cron_job($command, $active=false, $minute="0", $hour="*", $mont
write_config(sprintf(gettext("Removed cron job for %s"), $command));
}
}
configure_cron();
}
/**
......
......@@ -3122,6 +3122,7 @@ function upgrade_098_to_099() {
function upgrade_099_to_100()
{
install_cron_job("newsyslog", false);
configure_cron();
}
function upgrade_100_to_101()
......
......@@ -444,11 +444,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config();
// test / perform backup
try {
$filesInBackup = backup_to_google_drive() ;
$filesInBackup = backup_to_google_drive();
$cron_job = "/usr/local/opnsense/scripts/remote_backup.php";
if (!cron_job_exists($cron_job)) {
// initial cron job install
install_cron_job($cron_job,true,0,1);
install_cron_job($cron_job, true, 0, 1);
configure_cron();
}
} catch (Exception $e) {
$filesInBackup = array() ;
......
......@@ -224,6 +224,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
case 'monthly':
default:
install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "1", "*", "*");
break;
}
$config['system']['bogons']['interval'] = $pconfig['bogonsinterval'];
}
......@@ -237,6 +238,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$savemsg = get_std_save_message();
configure_cron();
filter_configure();
}
}
......
......@@ -47,19 +47,19 @@ function install_backup_cron_jobs()
if (!empty($config['system']['rrdbackup'])) {
install_cron_job("/usr/local/etc/rc.backup_rrd", ($config['system']['rrdbackup'] > 0), $minute = "0", "*/{$config['system']['rrdbackup']}");
} else {
install_cron_job("/usr/local/etc/rc.backup_rrd", false, $minute = "0", "*/{$config['system']['rrdbackup']}");
install_cron_job('/usr/local/etc/rc.backup_rrd', false);
}
if (!empty($config['system']['dhcpbackup'])) {
install_cron_job("/usr/local/etc/rc.backup_dhcpleases", ($config['system']['dhcpbackup'] > 0), $minute = "0", "*/{$config['system']['dhcpbackup']}");
} else {
install_cron_job("/usr/local/etc/rc.backup_dhcpleases", false, $minute = "0", "*/{$config['system']['dhcpbackup']}");
install_cron_job('/usr/local/etc/rc.backup_dhcpleases', false);
}
if (!empty($config['system']['netflowbackup'])) {
install_cron_job("/usr/local/etc/rc.backup_netflow", ($config['system']['netflowbackup'] > 0), $minute = "0", "*/{$config['system']['netflowbackup']}");
} else {
install_cron_job("/usr/local/etc/rc.backup_netflow", false, $minute = "0", "*/{$config['system']['netflowbackup']}");
install_cron_job('/usr/local/etc/rc.backup_netflow', false);
}
}
......@@ -236,6 +236,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
system_resolvconf_generate(true);
install_backup_cron_jobs();
configure_cron();
filter_configure();
activate_powerd();
load_crypto_module();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment