#!/usr/local/bin/php setCredentials('admin', $password); $resp = $cli->send($msg); } } if($already_processed != 1) { if($config['installedpackages']['carpsettings']['config'] != "" and is_array($config['installedpackages']['carpsettings']['config'])) { $already_processed = 1; foreach($config['installedpackages']['carpsettings']['config'] as $carp) { if($carp['synchronizetoip'] != "" ) { $synchronizetoip = $carp['synchronizetoip']; $sections = array(); $sections_xml = array(); if($carp['synchronizerules'] != "" and is_array($config['filter'])) { $sections_xml[] = new XML_RPC_Value(backup_config_section("filter"), 'string'); $sections[] = new XML_RPC_Value('filter', 'string'); } if($carp['synchronizenat'] != "" and is_array($config['nat'])) { $sections_xml[] = new XML_RPC_Value(backup_config_section("nat"), 'string'); $sections[] = new XML_RPC_Value('nat', 'string'); } if($carp['synchronizealiases'] != "" and is_array($config['aliases'])) { $sections_xml[] = new XML_RPC_Value(backup_config_section("aliases"), 'string'); $sections[] = new XML_RPC_Value('aliases', 'string'); } if($carp['synchronizetrafficshaper'] != "" and is_array($config['shaper'])) { $sections_xml[] = new XML_RPC_Value(backup_config_section("shaper"), 'string'); $sections[] = new XML_RPC_Value('shaper', 'string'); } carp_sync_xml($synchronizetoip, $carp['password'], $sections, $sections_xml); $cli = new XML_RPC_Client('/xmlrpc.php', $synchronizetoip); $msg = new XML_RPC_Message('pfsense.filter_configure', array(new XML_RPC_Value($carp['password'], 'string'))); $cli->setCredentials('admin', $carp['password']); $cli->send($msg); } } } } ?>