mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
rfc2136: split relevant rc.dyndns.update parts in half #1478
Now the old manual cron job only updates DynDNS, but the autocron will fix itself... :)
This commit is contained in:
parent
852261b688
commit
0dd2c69792
@ -1588,8 +1588,9 @@ function system_cron_configure($verbose = false)
|
||||
|
||||
/* daily */
|
||||
$autocron[] = generate_cron_job('/usr/local/etc/rc.update_alias_url_data', '1', '1');
|
||||
$autocron[] = generate_cron_job('/usr/local/etc/rc.update_urltables', '5', '1');
|
||||
$autocron[] = generate_cron_job('/usr/local/etc/rc.update_urltables', '6', '1');
|
||||
$autocron[] = generate_cron_job('/usr/local/etc/rc.dyndns.update', '11', '1');
|
||||
$autocron[] = generate_cron_job('/usr/local/etc/rc.rfc2136.update', '16', '1');
|
||||
|
||||
/* every now and then */
|
||||
$autocron[] = generate_cron_job('/usr/local/sbin/ping_hosts.sh', '*/4');
|
||||
|
||||
@ -32,8 +32,7 @@ require_once("interfaces.inc");
|
||||
require_once("util.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("services.inc");
|
||||
|
||||
/* Interface IP address has changed */
|
||||
require_once("plugins.inc.d/dyndns.inc");
|
||||
|
||||
if (isset($argv[1])) {
|
||||
$argument = trim($argv[1], " \n");
|
||||
@ -42,13 +41,11 @@ if (isset($argv[1])) {
|
||||
}
|
||||
|
||||
if (empty($argument)) {
|
||||
dyndns_configure_do();
|
||||
rfc2136_configure_do();
|
||||
dyndns_configure_do(true);
|
||||
} else {
|
||||
$interface = lookup_gateway_interface_by_name($argument);
|
||||
if (empty($interface)) {
|
||||
$interface = $argument;
|
||||
}
|
||||
dyndns_configure_do(false, $interface);
|
||||
rfc2136_configure_do(false, $interface);
|
||||
dyndns_configure_do(true, $interface);
|
||||
}
|
||||
|
||||
51
src/etc/rc.rfc2136.update
Executable file
51
src/etc/rc.rfc2136.update
Executable file
@ -0,0 +1,51 @@
|
||||
#!/usr/local/bin/php
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (C) 2004 Scott Ullrich
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
require_once("config.inc");
|
||||
require_once("interfaces.inc");
|
||||
require_once("util.inc");
|
||||
require_once("filter.inc");
|
||||
require_once("services.inc");
|
||||
require_once("plugins.inc.d/rfc2136.inc");
|
||||
|
||||
if (isset($argv[1])) {
|
||||
$argument = trim($argv[1], " \n");
|
||||
} else {
|
||||
$argument = null;
|
||||
}
|
||||
|
||||
if (empty($argument)) {
|
||||
rfc2136_configure_do(true);
|
||||
} else {
|
||||
$interface = lookup_gateway_interface_by_name($argument);
|
||||
if (empty($interface)) {
|
||||
$interface = $argument;
|
||||
}
|
||||
rfc2136_configure_do(true, $interface);
|
||||
}
|
||||
6
src/opnsense/service/conf/actions.d/actions_rfc2136.conf
Normal file
6
src/opnsense/service/conf/actions.d/actions_rfc2136.conf
Normal file
@ -0,0 +1,6 @@
|
||||
[reload]
|
||||
command:/usr/local/etc/rc.rfc2136.update
|
||||
description:RFC 2136 Update
|
||||
parameters:%s
|
||||
type:script
|
||||
message:updating rfc2136 %s
|
||||
Loading…
x
Reference in New Issue
Block a user