Commit 51fea877 authored by Franco Fichtner's avatar Franco Fichtner

plugins: repair #1483

parent 29490c8d
...@@ -43,9 +43,9 @@ function dyndns_configure() ...@@ -43,9 +43,9 @@ function dyndns_configure()
function dyndns_cron() function dyndns_cron()
{ {
$jobs = array('autocron' => array()); $jobs = array();
$jobs['autocron'][] = array('/usr/local/etc/rc.dyndns.update', '11', '1'); $jobs[]['autocron'] = array('/usr/local/etc/rc.dyndns.update', '11', '1');
return $jobs; return $jobs;
} }
......
...@@ -53,12 +53,12 @@ function pf_cron() ...@@ -53,12 +53,12 @@ function pf_cron()
{ {
global $config; global $config;
$jobs = array('autocron' => array()); $jobs = array();
if (isset($config['filter']['rule'])) { if (isset($config['filter']['rule'])) {
foreach ($config['filter']['rule'] as $rule) { foreach ($config['filter']['rule'] as $rule) {
if (!empty($rule['sched'])) { if (!empty($rule['sched'])) {
$jobs['autocron'][] = array('/usr/local/etc/rc.filter_configure', '0,15,30,45'); $jobs[]['autocron'] = array('/usr/local/etc/rc.filter_configure', '0,15,30,45');
break; break;
} }
} }
......
...@@ -38,11 +38,21 @@ function rfc2136_configure() ...@@ -38,11 +38,21 @@ function rfc2136_configure()
); );
} }
function rfc2136_enabled()
{
global $config;
/* XXX not entirely correct */
return isset($config['dnsupdates']['dnsupdate']);
}
function rfc2136_cron() function rfc2136_cron()
{ {
$jobs = array('autocron' => array()); $jobs = array();
$jobs['autocron'][] = array('/usr/local/etc/rc.rfc2136.update', '16', '1'); if (rfc2136_enabled()) {
$jobs[]['autocron'] = array('/usr/local/etc/rc.rfc2136.update', '16', '1');
}
return $jobs; return $jobs;
} }
...@@ -51,7 +61,7 @@ function rfc2136_configure_do($verbose = false, $int = '', $updatehost = '', $fo ...@@ -51,7 +61,7 @@ function rfc2136_configure_do($verbose = false, $int = '', $updatehost = '', $fo
{ {
global $config; global $config;
if (!isset($config['dnsupdates']['dnsupdate'])) { if (!rfc_2136_enabled()) {
return; return;
} }
...@@ -74,12 +84,13 @@ function rfc2136_configure_do($verbose = false, $int = '', $updatehost = '', $fo ...@@ -74,12 +84,13 @@ function rfc2136_configure_do($verbose = false, $int = '', $updatehost = '', $fo
$if = get_real_interface($dnsupdate['interface']); $if = get_real_interface($dnsupdate['interface']);
if (isset($dnsupdate['usepublicip'])) { if (isset($dnsupdate['usepublicip'])) {
$wanip = get_dyndns_ip($dnsupdate['interface']); $wanip = get_dyndns_ip($dnsupdate['interface'], 4);
$wanipv6 = get_dyndns_ip($dnsupdate['interface'], 6);
} else { } else {
$wanip = get_interface_ip($dnsupdate['interface']); $wanip = get_interface_ip($dnsupdate['interface']);
$wanipv6 = get_interface_ipv6($dnsupdate['interface']);
} }
$wanipv6 = get_interface_ipv6($dnsupdate['interface']);
$cacheFile = "/conf/dyndns_{$dnsupdate['interface']}_rfc2136_" . escapeshellarg($dnsupdate['host']) . "_{$dnsupdate['server']}.cache"; $cacheFile = "/conf/dyndns_{$dnsupdate['interface']}_rfc2136_" . escapeshellarg($dnsupdate['host']) . "_{$dnsupdate['server']}.cache";
$currentTime = time(); $currentTime = time();
......
...@@ -1589,9 +1589,7 @@ function system_cron_configure($verbose = false) ...@@ -1589,9 +1589,7 @@ function system_cron_configure($verbose = false)
* and conquer the code bits... :) * and conquer the code bits... :)
*/ */
if (!empty($cron_plugin['autocron'])) { if (!empty($cron_plugin['autocron'])) {
foreach ($cron_plugin['autocron'] as $cron_job) { $autocron[] = call_user_func_array('generate_cron_job', $cron_plugin['autocron']);
$autocron[] = call_user_func_array('generate_cron_job', $cron_job);
}
} }
} }
......
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