public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 59124eeb2aacdee2229b68e128cfa8c738ee1a68
Date: Fri, 07 Mar 2014 16:33:53 +0100	[thread overview]
Message-ID: <20140307153353.B086320F0E@argus.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 3409 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  59124eeb2aacdee2229b68e128cfa8c738ee1a68 (commit)
       via  dc98645fd42873dfeda01188243565e2f977f4a9 (commit)
      from  3c3f0b664eb09375e084e969038154899fecf162 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 59124eeb2aacdee2229b68e128cfa8c738ee1a68
Merge: dc98645 3c3f0b6
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Fri Mar 7 16:33:42 2014 +0100

    Merge branch 'next' of ssh://git.ipfire.org/pub/git/ipfire-2.x into next

commit dc98645fd42873dfeda01188243565e2f977f4a9
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Fri Mar 7 16:33:03 2014 +0100

    setddns.pl: Use GetDyndnsRedIP from general-functions.pl.
    
    http://forum.ipfire.org/index.php?topic=7504.msg63721#msg63721

-----------------------------------------------------------------------

Summary of changes:
 src/scripts/setddns.pl | 34 ++++++----------------------------
 1 file changed, 6 insertions(+), 28 deletions(-)

Difference in files:
diff --git a/src/scripts/setddns.pl b/src/scripts/setddns.pl
index 12c0f1d..f97e750 100644
--- a/src/scripts/setddns.pl
+++ b/src/scripts/setddns.pl
@@ -44,37 +44,15 @@ if (open(FILE, "$filename")) {
 # ignore monthly update if not in minimize update mode
 exit 0 if (($settings{'MINIMIZEUPDATES'} ne 'on') && ($ARGV[1] eq '-m'));
 
-my $ip;
-if (open(IP, "${General::swroot}/red/local-ipaddress")) {
-    $ip = <IP>;
-    close(IP);
-    chomp $ip;
-} else {
-    &General::log('Dynamic DNS failure : unable to open local-ipaddress file.');
-    exit 0;
-}
+my $ip = &General::GetDyndnsRedIP();
 
-#If IP is reserved network, we are behind a router. May we ask for our real public IP ?
-if ( &General::IpInSubnet ($ip,'10.0.0.0','255.0.0.0') ||
-     &General::IpInSubnet ($ip,'172.16.0.0','255.240.0.0') ||
-     &General::IpInSubnet ($ip,'192.168.0.0','255.255.0.0')) {
-    # We can, but are we authorized by GUI ?
-    if ($settings{'BEHINDROUTER'} eq 'FETCH_IP') {
-	if ($ARGV[0] eq '-f'){
-	    $settings{'BEHINDROUTERWAITLOOP'} = -1; # When forced option, fectch PublicIP now
-	}
-
-	# Increment counter modulo 4. When it is zero, fetch ip else exit
-	# This divides by 4 the requests to the dyndns server.
-	$settings{'BEHINDROUTERWAITLOOP'} = ($settings{'BEHINDROUTERWAITLOOP'}+1) %4;
-	&General::writehash("${General::swroot}/ddns/settings", \%settings);
-	exit 0 if ( $settings{'BEHINDROUTERWAITLOOP'} ne 0 );
-	my $RealIP = &General::FetchPublicIp;
-	$ip = (&General::validip ($RealIP) ?  $RealIP : 'unavailable');
-	&General::log ("Dynamic DNS public router IP is:$ip");
-    }
+if ($ip eq "unavailable") {
+	&General::log("Dynamic DNS error: RED/Public IP is unavailable");
+	exit(0);
 }
 
+&General::log("Dynamic DNS public router IP is: $ip");
+
 if ($ARGV[0] eq '-f') {
 	unlink ($cachefile);	# next regular calls will try again if this force update fails.
 } else {


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2014-03-07 15:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140307153353.B086320F0E@argus.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox