Project

General

Profile

« Previous | Next » 

Revision 181d7c95

Added by Ermal Luçi almost 17 years ago

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.

View differences:

etc/inc/services.inc
468 468
	return 0;
469 469
}
470 470

  
471
function services_dyndns_configure_client($conf) {
472

  
473
	/* determine interface name */
474
	$if = get_real_wan_interface($conf['interface']);
475

  
476
	/* load up the dyndns.class */
477
	require_once("dyndns.class");
478

  
479
	log_error("DynDns: Running updatedns()");
480

  
481
	$dns = new updatedns($dnsService = $conf['type'],
482
		$dnsHost = $conf['host'],
483
		$dnsUser = $conf['username'],
484
		$dnsPass = $conf['password'],
485
		$dnsWilcard = $conf['wildcard'],
486
		$dnsMX = $conf['mx'], $dnsIf = "{$if}");
487

  
488
}
489

  
471 490
function services_dyndns_configure() {
472 491
	global $config, $g;
473 492
	if(isset($config['system']['developerspew'])) {
......
478 497
	$dyndnscfg = $config['dyndnses']['dyndns'];
479 498

  
480 499
	if (is_array($dyndnscfg)) {
500
		if ($g['booting']) 
501
			echo "Starting DynDNS clients...";
502

  
481 503
		foreach ($dyndnscfg as $dyndns) {
482 504
			if (!isset($dyndns['enable']))
483 505
				continue;
484
			/* determine interface name */
485
			$if = get_real_wan_interface($dyndns['interface']);
486

  
487
			if ($g['booting']) 
488
				echo "Starting DynDNS clients...";
489
			else 
490
				sleep(1);
491 506

  
492
			/* load up the dyndns.class */
493
			require_once("dyndns.class");
494

  
495
			log_error("DynDns: Running updatedns()");
496

  
497
			$dns = new updatedns($dnsService = $dyndns['type'],
498
							 $dnsHost = $dyndns['host'],
499
							 $dnsUser = $dyndns['username'],
500
							 $dnsPass = $dyndns['password'],
501
							 $dnsWilcard = $dyndns['wildcard'],
502
							 $dnsMX = $dyndns['mx'], $dnsIf = "{$if}");
507
			services_dyndns_configure_client($dyndns);
503 508

  
509
			sleep(1);
504 510
		}
505 511

  
506 512
		if ($g['booting'])

Also available in: Unified diff