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

cron: the bogon job; #911

parent 65882381
...@@ -2349,12 +2349,13 @@ function configure_cron() ...@@ -2349,12 +2349,13 @@ function configure_cron()
'/usr/local/etc/rc.backup_dhcpleases', '/usr/local/etc/rc.backup_dhcpleases',
'/usr/local/etc/rc.backup_netflow', '/usr/local/etc/rc.backup_netflow',
'/usr/local/etc/rc.backup_rrd', '/usr/local/etc/rc.backup_rrd',
'/usr/local/etc/rc.update_bogons',
); );
foreach ($obsoletes as $obsolete) { foreach ($obsoletes as $obsolete) {
/* /*
* Strip old cron jobs that we no longer save explicitly. * Strip old cron jobs that we no longer save explicitly.
* This can be savely removed on our final road to 17.1. * This can be safely removed on our final road to 17.1.
*/ */
install_cron_job($obsolete, false); install_cron_job($obsolete, false);
} }
...@@ -2373,6 +2374,20 @@ function configure_cron() ...@@ -2373,6 +2374,20 @@ function configure_cron()
$autocron[] = generate_cron_job('/usr/local/etc/rc.backup_netflow', $minute = '0', '*/' . $config['system']['netflowbackup']); $autocron[] = generate_cron_job('/usr/local/etc/rc.backup_netflow', $minute = '0', '*/' . $config['system']['netflowbackup']);
} }
/* bogons fetch always set in default config.xml */
switch ($config['system']['bogons']['interval']) {
case 'daily':
install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "*", "*", "*");
break;
case 'weekly':
install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "*", "*", "0");
break;
case 'monthly':
default:
install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "1", "*", "*");
break;
}
$anchor = '# custom crontab entries'; $anchor = '# custom crontab entries';
/* preserve existing crontab entries */ /* preserve existing crontab entries */
......
...@@ -214,18 +214,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -214,18 +214,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
if ($pconfig['bogonsinterval'] != $config['system']['bogons']['interval']) { if ($pconfig['bogonsinterval'] != $config['system']['bogons']['interval']) {
switch ($pconfig['bogonsinterval']) {
case 'daily':
install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "*", "*", "*");
break;
case 'weekly':
install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "*", "*", "0");
break;
case 'monthly':
default:
install_cron_job("/usr/local/etc/rc.update_bogons", true, "1", "3", "1", "*", "*");
break;
}
$config['system']['bogons']['interval'] = $pconfig['bogonsinterval']; $config['system']['bogons']['interval'] = $pconfig['bogonsinterval'];
} }
......
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