]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/scripts/setddns.pl
DDNS: Support for all-inkl.com.
[people/teissler/ipfire-2.x.git] / src / scripts / setddns.pl
index 6c4c3697f1a119fde083d090370bb8b84996a7fa..0833b49c0d4989399e798d68cea0335a1e36dfc5 100644 (file)
@@ -150,6 +150,27 @@ if ($ip ne $ipcache) {
                                }
                        }
 
+                       elsif ($settings{'SERVICE'} eq 'all-inkl') {
+                           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("dyndns.kasserver.com", 80, "/", Net::SSLeay::make_headers(
+                                       'User-Agent' => 'IPFire', 'Authorization' => 'Basic ' . encode_base64("$settings{'LOGIN'}:$settings{'PASSWORD'}")
+                           ));
+
+                           # Valid response are 'ok'   'nochange'
+                           if ($response =~ m%HTTP/1\.. 200 OK%) {
+                               &General::log("Dynamic DNS ip-update for $settings{'HOSTNAME'}.$settings{'DOMAIN'} : success");
+                               $success++;
+                           } else {
+                               &General::log("Dynamic DNS ip-update for $settings{'HOSTNAME'}.$settings{'DOMAIN'} : failure (could not connect to server, check your credentials)");
+                           }
+                       }
+
                        elsif ($settings{'SERVICE'} eq 'cjb') {
                            # use proxy ?
                            my %proxysettings;