summaryrefslogtreecommitdiffstats
path: root/etc/rc.filter_synchronize
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-12-22 11:06:08 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-12-22 11:06:26 -0500
commitba482f415164fdc989de9a79380f53648fdaa5ae (patch)
tree2926548051b8360c5099ae7be674dcdf87a70f38 /etc/rc.filter_synchronize
parent9c7b9ba04c0e6e9e356f0a5be53741617b59ab96 (diff)
downloadpfsense-ba482f415164fdc989de9a79380f53648fdaa5ae.zip
pfsense-ba482f415164fdc989de9a79380f53648fdaa5ae.tar.gz
Fix whitespace.
Diffstat (limited to 'etc/rc.filter_synchronize')
-rwxr-xr-xetc/rc.filter_synchronize73
1 files changed, 36 insertions, 37 deletions
diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize
index 0a8316b..63fb9aa 100755
--- a/etc/rc.filter_synchronize
+++ b/etc/rc.filter_synchronize
@@ -94,46 +94,45 @@ function carp_check_version($url, $password, $port = 80, $method = 'pfsense.host
if(file_exists("{$g['varrun_path']}/booting") || $g['booting'])
return;
- $params = array(
- XML_RPC_encode($password)
- );
-
- $numberofruns = 0;
- while ($numberofruns < 2) {
- $msg = new XML_RPC_Message($method, $params);
- $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
- $username = $config['system']['user'][0]['name'];
- $cli->setCredentials($username, $password);
- if($numberofruns > 1)
- $cli->setDebug(1);
- /* send our XMLRPC message and timeout after 240 seconds */
- $resp = $cli->send($msg, "240");
+ $params = array(
+ XML_RPC_encode($password)
+ );
+
+ $numberofruns = 0;
+ while ($numberofruns < 2) {
+ $msg = new XML_RPC_Message($method, $params);
+ $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
+ $username = $config['system']['user'][0]['name'];
+ $cli->setCredentials($username, $password);
+ if($numberofruns > 1)
+ $cli->setDebug(1);
+ /* send our XMLRPC message and timeout after 240 seconds */
+ $resp = $cli->send($msg, "240");
if(!is_object($resp)) {
- $error = "A communications error occured while attempting XMLRPC sync with username {$username} {$url}:{$port}.";
- } elseif($resp->faultCode()) {
- $error = "An error code was received while attempting XMLRPC sync with username {$username} {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
- } else {
- $parsed_response = XML_RPC_decode($resp->value());
- if(!is_array($parsed_response)) {
- if (trim($parsed_response) == "Authentication failed") {
- $error = "A authentication failure occurred while trying to access {$url}:{$port} ({$method}).";
- log_error($error);
- file_notice("sync_settings", $error, "Settings Sync", "");
- exit;
+ $error = "A communications error occured while attempting XMLRPC sync with username {$username} {$url}:{$port}.";
+ } elseif($resp->faultCode()) {
+ $error = "An error code was received while attempting XMLRPC sync with username {$username} {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
+ } else {
+ $parsed_response = XML_RPC_decode($resp->value());
+ if(!is_array($parsed_response)) {
+ if (trim($parsed_response) == "Authentication failed") {
+ $error = "A authentication failure occurred while trying to access {$url}:{$port} ({$method}).";
+ log_error($error);
+ file_notice("sync_settings", $error, "Settings Sync", "");
+ exit;
+ }
+ } else {
+ if (!isset($parsed_response['config_version']) ||
+ $parsed_response['config_version'] < $config['version'])
+ return false;
+ else
+ return true;
}
- } else {
- if (!isset($parsed_response['config_version']) ||
- $parsed_response['config_version'] < $config['version'])
- return false;
- else
- return true;
}
+ log_error($error);
+ file_notice("sync_settings", $error, "Settings Sync", "");
+ $numberofruns++;
}
- log_error($error);
- file_notice("sync_settings", $error, "Settings Sync", "");
- $numberofruns++;
- }
-
return false;
}
@@ -418,4 +417,4 @@ if (is_array($config['installedpackages']['carpsettings']['config'])) {
}
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud