]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Add "mydyn.de" ddns service
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 27 Sep 2008 09:05:20 +0000 (11:05 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sat, 27 Sep 2008 09:05:20 +0000 (11:05 +0200)
html/cgi-bin/ddns.cgi
src/scripts/setddns.pl

index b70c509590a8315825db1d5f957ae5e3015c8786..4dba22f535a058949936ce7f83c9b7c77d4da879 100644 (file)
@@ -243,6 +243,7 @@ $checked{'SERVICE'}{'easydns.com'} = '';
 $checked{'SERVICE'}{'enom.com'} = '';
 $checked{'SERVICE'}{'freedns.afraid.org'} = '';
 $checked{'SERVICE'}{'hn.org'} = '';
+$checked{'SERVICE'}{'mydyn.de'} = '';
 $checked{'SERVICE'}{'no-ip.com'} = '';
 $checked{'SERVICE'}{'nsupdate'} = '';
 $checked{'SERVICE'}{'ovh.com'} = '';
@@ -335,6 +336,7 @@ print <<END
     <option $checked{'SERVICE'}{'enom.com'}>enom.com</option>
     <option $checked{'SERVICE'}{'freedns.afraid.org'}>freedns.afraid.org</option>
     <option $checked{'SERVICE'}{'hn.org'}>hn.org</option>
+    <option $checked{'SERVICE'}{'mydyn.de'}>mydyn.de</option>
     <option $checked{'SERVICE'}{'no-ip.com'}>no-ip.com</option>
     <option $checked{'SERVICE'}{'nsupdate'}>nsupdate</option>
     <option $checked{'SERVICE'}{'ovh.com'}>ovh.com</option>
index 775c6ed03b2f3ed185b9324c82d8f1fcaba605f2..73d91904571e5da32fd19252bba1cdc14c2f5888 100644 (file)
@@ -75,7 +75,6 @@ if ( &General::IpInSubnet ($ip,'10.0.0.0','255.0.0.0') ||
     }
 }
 
-
 if ($ARGV[0] eq '-f') {
        unlink ($cachefile);    # next regular calls will try again if this force update fails.
 } else {
@@ -175,6 +174,33 @@ if ($ip ne $ipcache) {
                                &General::log("Dynamic DNS ip-update for cjb.net ($settings{'LOGIN'}) : failure (could not connect to server)");
                            }
                        }
+                       elsif ($settings{'SERVICE'} eq 'mydyn') {
+                           # use proxy ?
+                           my %proxysettings;
+                           &General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
+                           if ($_=$proxysettings{'UPSTREAM_PROXY'}) {
+                               my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/);
+                               Net::SSLeay::set_proxy($peer,$peerport,$proxysettings{'UPSTREAM_USER'},$proxysettings{'UPSTREAM_PASSWORD'} );
+                           }
+
+                           my ($out, $response) = Net::SSLeay::get_http(  'www.mydyn.de',
+                                                                           80,
+                                                                           "/cgi-bin/update.pl?$settings{'LOGIN'}-$settings{'PASSWORD'}",
+                                                                           Net::SSLeay::make_headers('User-Agent' => 'IPFire' )
+                                                                       );
+
+                           if ($response =~ m%HTTP/1\.. 200 OK%) {
+                               if ( $out !~ m/The IP address of the subdomain/ ) {
+                                   &General::log("Dynamic DNS ip-update for mydyn.de ($settings{'LOGIN'}) : failure (bad password or login)");
+                               } else {
+                                   &General::log("Dynamic DNS ip-update for mydyn.de ($settings{'LOGIN'}) : success");
+                                   $success++;
+                               }
+                           } else {
+                               &General::log("Dynamic DNS ip-update for mydyn.de ($settings{'LOGIN'}) : failure (could not connect to server)");
+                           }
+
+                       }
                        elsif ($settings{'SERVICE'} eq 'selfhost') {
                            # use proxy ?
                            my %proxysettings;