aboutsummaryrefslogtreecommitdiffstats
path: root/config/sshdcond
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-08-09 19:58:33 +0200
committerdoktornotor <notordoktor@gmail.com>2015-08-09 19:58:33 +0200
commit8d16f1a0ecfe675de1b78639da7db18295d115a9 (patch)
tree3fcee63d618b9241008a2f6f5ca6cc69de8067af /config/sshdcond
parent268764e87ab8d2371542d8676f3bec3a4d436ce4 (diff)
downloadpfsense-packages-8d16f1a0ecfe675de1b78639da7db18295d115a9.tar.gz
pfsense-packages-8d16f1a0ecfe675de1b78639da7db18295d115a9.tar.bz2
pfsense-packages-8d16f1a0ecfe675de1b78639da7db18295d115a9.zip
sshdcond - fix sshdcond_sync_on_changes() logic
Diffstat (limited to 'config/sshdcond')
-rw-r--r--config/sshdcond/sshdcond.inc29
1 files changed, 16 insertions, 13 deletions
diff --git a/config/sshdcond/sshdcond.inc b/config/sshdcond/sshdcond.inc
index 756f1556..fa996386 100644
--- a/config/sshdcond/sshdcond.inc
+++ b/config/sshdcond/sshdcond.inc
@@ -117,19 +117,22 @@ function sshdcond_custom_php_write_config() {
function sshdcond_sync_on_changes() {
global $config, $g;
- if (is_array($config['installedpackages']['sshdcondsync'])) {
- if (!$config['installedpackages']['sshdcondsync']['config'][0]['synconchanges']) {
- return;
- }
- }
-
- log_error("[sshdcond] xmlrpc sync is starting.");
- foreach ($config['installedpackages']['sshdcondsync']['config'] as $rs) {
- foreach($rs['row'] as $sh) {
- $sync_to_ip = $sh['ipaddress'];
- $password = $sh['password'];
- if ($password && $sync_to_ip) {
- sshdcond_do_xmlrpc_sync($sync_to_ip, $password);
+ if (!is_array($config['installedpackages']['sshdcondsync'])) {
+ /* Basically, this package was never configured */
+ return;
+ } elseif (!$config['installedpackages']['sshdcondsync']['config'][0]['synconchanges']) {
+ /* Package is configured but XMLRPC sync is disabled */
+ return;
+ } else {
+ /* Do XMLRPC sync */
+ log_error("[sshdcond] xmlrpc sync is starting.");
+ foreach ($config['installedpackages']['sshdcondsync']['config'] as $rs) {
+ foreach($rs['row'] as $sh) {
+ $sync_to_ip = $sh['ipaddress'];
+ $password = $sh['password'];
+ if ($password && $sync_to_ip) {
+ sshdcond_do_xmlrpc_sync($sync_to_ip, $password);
+ }
}
}
}