]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
DDNS: Add support for variomedia.de.
authorStefan Ernst <sternst@ernx.de>
Sun, 11 May 2014 17:53:00 +0000 (19:53 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 11 May 2014 18:06:20 +0000 (20:06 +0200)
This commit adds support for the dynamic dns service provider variomedia.de.

Fixes #10485.

html/cgi-bin/ddns.cgi
src/scripts/setddns.pl

index ae981a42f5b07bd9aeff5eb75a5022c71b264cd7..dc4649b4a5d0bde56ef9398af6128d74486c6865 100644 (file)
@@ -256,6 +256,7 @@ $checked{'SERVICE'}{'selfhost.de'} = '';
 $checked{'SERVICE'}{'strato.com'} = '';
 $checked{'SERVICE'}{'twodns.de'} = '';
 $checked{'SERVICE'}{'tzo.com'} = '';
+$checked{'SERVICE'}{'variomedia.de'} = '';
 $checked{'SERVICE'}{'zoneedit.com'} = '';
 $checked{'SERVICE'}{$settings{'SERVICE'}} = "selected='selected'";
 
@@ -353,6 +354,7 @@ print <<END
     <option $checked{'SERVICE'}{'strato.com'}>strato.com</option>
     <option $checked{'SERVICE'}{'twodns.de'}>twodns.de</option>
 <!--    <option $checked{'SERVICE'}{'tzo.com'}>tzo.com</option>        comment this service out until a working fix is developed -->
+    <option $checked{'SERVICE'}{'variomedia.de'}>variomedia.de</option>
     <option $checked{'SERVICE'}{'zoneedit.com'}>zoneedit.com</option>
     </select></td>
     <td width='20%' class='base'>$Lang::tr{'hostname'}:&nbsp;<img src='/blob.gif' alt='*' /></td>
index 939e9f2549643523b4046583bba6bac17bf452cd..d5f7e088891270fa4caa330021d6f8faf1aa51bc 100644 (file)
@@ -684,6 +684,39 @@ if ($ip ne $ipcache) {
                                 &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server, check your credentials---$out-$response--)");
                             }
                         }
+                       elsif ($settings{'SERVICE'} eq 'variomedia') { 
+                           # 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'} );
+                           }
+                           if ($settings{'HOSTNAME'} eq '') {
+                               $settings{'HOSTDOMAIN'} = $settings{'DOMAIN'};
+                           } else {
+                               $settings{'HOSTDOMAIN'} = "$settings{'HOSTNAME'}.$settings{'DOMAIN'}";
+                           }
+                           my ($out, $response) = Net::SSLeay::get_https( 'dyndns.variomedia.de',
+                                                                           443,
+                                                                           "/nic/update?hostname=$settings{'HOSTDOMAIN'}&myip=$ip",
+                                                                           Net::SSLeay::make_headers('User-Agent' => 'IPFire',
+                                                                                                     'Authorization' => 'Basic ' . encode_base64("$settings{'LOGIN'}:$settings{'PASSWORD'}")) );
+                           # Valid response is 'good $ip'
+                           if ($response =~ m%HTTP/1\.. 200 OK%) {
+                               if ( $out !~ m/^good $ip/ ) {
+                                   &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} ($ip) : failure ($out)");
+                               } else {
+                                   &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} ($ip) : success");
+                                   $success++;
+                               }
+                           } else {
+                               &General::log("Dynamic DNS ip-update for $settings{'HOSTDOMAIN'} : failure (could not connect to server, check your credentials---$out-$response--)");
+                           }
+                       }
                        else {
                                if ($settings{'WILDCARDS'} eq 'on') {
                                    $settings{'WILDCARDS'} = '-w';