diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-02-14 05:08:00 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-02-14 05:08:00 +0000 |
commit | c0379721edc8f2ff4cf04c5a07e77364d8a275e4 (patch) | |
tree | 30950433d02f62640660109d2ad6370120320787 /packages/tinydns/tinydns.inc | |
parent | e35b092b0e9c8a261899decd1d3cd857a55a95b3 (diff) | |
download | pfsense-packages-c0379721edc8f2ff4cf04c5a07e77364d8a275e4.tar.gz pfsense-packages-c0379721edc8f2ff4cf04c5a07e77364d8a275e4.tar.bz2 pfsense-packages-c0379721edc8f2ff4cf04c5a07e77364d8a275e4.zip |
* Reload target sync hosts zone records after a sync
* Add 2 more optional sync hosts so that we can sync to 2 extra hosts
making it easier to manage 3 hosts that run tinydns.
Diffstat (limited to 'packages/tinydns/tinydns.inc')
-rw-r--r-- | packages/tinydns/tinydns.inc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/tinydns/tinydns.inc b/packages/tinydns/tinydns.inc index e1012334..6fc4f522 100644 --- a/packages/tinydns/tinydns.inc +++ b/packages/tinydns/tinydns.inc @@ -477,6 +477,38 @@ function tinydns_do_xmlrpc_sync($sync_to_ip, $password) { } else { log_error("tinydns XMLRPC sync successfully completed with {$url}:{$port}."); } + + /* tell tinydns to reload our settings on the destionation sync host. */ + + $method = 'pfsense.exec_php'; + + $execcmd = "require('/usr/local/pkg/tinydns.inc');\n"; + $execcmd .= "tinydns_custom_php_changeip_command();\n"; + $execcmd .= "tinydns_custom_php_install_command();\n"; + $execcmd .= "tinydns_create_zone_file();\n"; + $execcmd .= "tinydns_setup_ping_items();\n"; + + /* assemble xmlrpc payload */ + $params = array( + XML_RPC_encode($password), + XML_RPC_encode($execcmd) + ); + + $resp = $cli->send($msg, "250"); + if(!$resp) { + $error = "A communications error occured while attempting tinydns XMLRPC sync with {$url}:{$port}."; + log_error($error); + file_notice("sync_settings", $error, "tinydns Settings Sync", ""); + } elseif($resp->faultCode()) { + $cli->setDebug(1); + $resp = $cli->send($msg, "250"); + $error = "An error code was received while attempting tinydns XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString(); + log_error($error); + file_notice("sync_settings", $error, "tinydns Settings Sync", ""); + } else { + log_error("tinydns XMLRPC sync successfully completed with {$url}:{$port}."); + } + log_error("[tinydns] tinydns_xmlrpc_sync.php is ending."); } |