summaryrefslogtreecommitdiffstats
path: root/etc/rc.filter_synchronize
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-06-11 11:47:56 -0400
committerjim-p <jimp@pfsense.org>2010-06-11 11:50:54 -0400
commit9434370cd00b9b2bf12be0add969d92730810d3d (patch)
tree76fca0e07610971ecf91ce91424ca98faf0e2f26 /etc/rc.filter_synchronize
parentddc75a80690a26e3368e1c2692f9a0940ba831f3 (diff)
downloadpfsense-9434370cd00b9b2bf12be0add969d92730810d3d.zip
pfsense-9434370cd00b9b2bf12be0add969d92730810d3d.tar.gz
Sync OpenVPN settings and DHCP Daemon settings via XMLRPC, and for DHCP set a proper failover IP where needed. Ticket #645 & Ticket #646 - Still needs a way to sync/restart services on Backup after config sync.
Diffstat (limited to 'etc/rc.filter_synchronize')
-rwxr-xr-xetc/rc.filter_synchronize15
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize
index 6e49ed3..36cb100 100755
--- a/etc/rc.filter_synchronize
+++ b/etc/rc.filter_synchronize
@@ -41,6 +41,7 @@ require_once("functions.inc");
require_once("filter.inc");
require_once("shaper.inc");
require_once("xmlrpc.inc");
+require_once("interfaces.inc");
/*
* backup_vip_config_section($section): returns as an xml file string of
@@ -146,6 +147,16 @@ function carp_sync_xml($url, $password, $sections, $port = 80, $method = 'pfsens
}
}
+ if (is_array($config_copy['dhcpd'])) {
+ foreach($config_copy['dhcpd'] as $dhcpif => $dhcpifconf) {
+ if($dhcpifconf['failover_peerip'] <> "") {
+ $int = guess_interface_from_ip($dhcpifconf['failover_peerip']);
+ $intip = find_interface_ip($int);
+ $config_copy['dhcpd'][$dhcpif]['failover_peerip'] = $intip;
+ }
+ }
+ }
+
foreach ($sections as $section) {
/* we can't use array_intersect_key()
* due to the vip 'special case'
@@ -244,6 +255,10 @@ if (is_array($config['installedpackages']['carpsettings']['config'])) {
$sections[] = 'load_balancer';
if ($carp['synchronizeipsec'] != "" and is_array($config['ipsec']))
$sections[] = 'ipsec';
+ if ($carp['synchronizeopenvpn'] != "" and is_array($config['openvpn']))
+ $sections[] = 'openvpn';
+ if ($carp['synchronizedhcpd'] != "" and is_array($config['dhcpd']))
+ $sections[] = 'dhcpd';
if ($carp['synchronizednsforwarder'] != "" and is_array($config['dnsmasq']))
$sections[] = 'dnsmasq';
if ($carp['synchronizeschedules'] != "" and is_array($config['schedules']))
OpenPOWER on IntegriCloud