summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-07-20 20:35:47 +0000
committerErmal Luçi <eri@pfsense.org>2008-07-20 20:35:47 +0000
commit181d7c95c7333cadc8256ef4a3260460b7d45ca0 (patch)
tree0cbf92f2e3222cc1fc83bec35bd41a857b998771
parent07cdb9a2db2b6a6fb49ac5f970427bd2a537e8d3 (diff)
downloadpfsense-181d7c95c7333cadc8256ef4a3260460b7d45ca0.zip
pfsense-181d7c95c7333cadc8256ef4a3260460b7d45ca0.tar.gz
Split dyndns client configuration to its own function so we do not retry to update all
other configured clients when add a new one from the GUI.
-rw-r--r--etc/inc/services.inc42
1 files changed, 24 insertions, 18 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index 9fe6b72..ac796a8 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -468,6 +468,25 @@ function services_dyndns_reset($interface, $dyndnsservice) {
return 0;
}
+function services_dyndns_configure_client($conf) {
+
+ /* determine interface name */
+ $if = get_real_wan_interface($conf['interface']);
+
+ /* load up the dyndns.class */
+ require_once("dyndns.class");
+
+ log_error("DynDns: Running updatedns()");
+
+ $dns = new updatedns($dnsService = $conf['type'],
+ $dnsHost = $conf['host'],
+ $dnsUser = $conf['username'],
+ $dnsPass = $conf['password'],
+ $dnsWilcard = $conf['wildcard'],
+ $dnsMX = $conf['mx'], $dnsIf = "{$if}");
+
+}
+
function services_dyndns_configure() {
global $config, $g;
if(isset($config['system']['developerspew'])) {
@@ -478,29 +497,16 @@ function services_dyndns_configure() {
$dyndnscfg = $config['dyndnses']['dyndns'];
if (is_array($dyndnscfg)) {
+ if ($g['booting'])
+ echo "Starting DynDNS clients...";
+
foreach ($dyndnscfg as $dyndns) {
if (!isset($dyndns['enable']))
continue;
- /* determine interface name */
- $if = get_real_wan_interface($dyndns['interface']);
-
- if ($g['booting'])
- echo "Starting DynDNS clients...";
- else
- sleep(1);
- /* load up the dyndns.class */
- require_once("dyndns.class");
-
- log_error("DynDns: Running updatedns()");
-
- $dns = new updatedns($dnsService = $dyndns['type'],
- $dnsHost = $dyndns['host'],
- $dnsUser = $dyndns['username'],
- $dnsPass = $dyndns['password'],
- $dnsWilcard = $dyndns['wildcard'],
- $dnsMX = $dyndns['mx'], $dnsIf = "{$if}");
+ services_dyndns_configure_client($dyndns);
+ sleep(1);
}
if ($g['booting'])
OpenPOWER on IntegriCloud