From 0be93267a678021ab9c5de04be0976e83cd17011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Fri, 11 Dec 2009 11:42:41 +0000 Subject: Touch up some comments and error messages. Teach dydns_configure to update only one interface. --- etc/inc/services.inc | 8 +++++++- etc/rc.newwanip | 10 +++++----- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'etc') diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 19bc5cc..ebf60f9 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -577,7 +577,7 @@ function services_dyndns_configure_client($conf) { } -function services_dyndns_configure() { +function services_dyndns_configure($int = "") { global $config, $g; if(isset($config['system']['developerspew'])) { $mt = microtime(); @@ -594,9 +594,15 @@ function services_dyndns_configure() { if (!isset($dyndns['enable'])) continue; + if (!empty($int) && $int != $dyndns['interface']) + continue; + services_dyndns_configure_client($dyndns); sleep(1); + + if (!empty($int)) + break; } if ($g['booting']) diff --git a/etc/rc.newwanip b/etc/rc.newwanip index 6ea7554..db381bd 100755 --- a/etc/rc.newwanip +++ b/etc/rc.newwanip @@ -38,7 +38,7 @@ require_once("functions.inc"); require_once("filter.inc"); require_once("shaper.inc"); -/* WAN IP address has changed */ +/* Interface IP address has changed */ $argument = str_replace("\n", "", $argv[1]); @@ -72,7 +72,7 @@ if($old_ip) { if($helpers) mwexec("kill " . trim($helpers)); } else { - log_error("WARNING! /etc/rc.newwanip could not determine the previous IP address ( $interface_real )."); + log_error("WARNING! /etc/rc.newwanip could not determine the previous IP address of {$interface}( {$interface_real} )."); } /* reconfigure IPsec tunnels */ @@ -95,9 +95,9 @@ if ($fd) { fclose($fd); } -log_error("Informational: DHClient spawned /etc/rc.newwanip and the new ip is {$interface} - {$curwanip}."); +log_error("Informational: DHClient spawned /etc/rc.newwanip for interface {$interface} with new ip {$curwanip}."); -touch("/tmp/update_dyndns"); +file_put_contents("/tmp/update_dyndns", $interface); /* signal filter reload */ unlink_if_exists("/tmp/config.cache"); @@ -122,4 +122,4 @@ if($old_ip <> "") { setup_gateways_monitor(); return 0; -?> \ No newline at end of file +?> -- cgit v1.1