aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
+ }
}
}
}