DDNS: Support for all-inkl.com.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Aug 2013 15:38:12 +0000 (17:38 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Aug 2013 16:12:01 +0000 (18:12 +0200)
Requested by Daniel Kovacs <daniel.kovacs@pleasuredome.org>.

config/rootfiles/core/72/filelists/files
html/cgi-bin/ddns.cgi
src/scripts/setddns.pl

index 7ab00d485eb04732f6c60c320a04358c501889a6..f20186d7bf8ae96f3152fcfda523d08a17cddb64 100644 (file)
@@ -1,4 +1,6 @@
 etc/system-release
 etc/issue
+srv/web/ipfire/cgi-bin/ddns.cgi
 srv/web/ipfire/cgi-bin/vpnmain.cgi
 usr/local/bin/openvpnctrl
+usr/local/bin/setddns.pl
index d840d39469afa2017ad951e5fdb058f12b4aac37..88847a050b04171d9b191aca28e4a1f18db25bd0 100644 (file)
@@ -232,6 +232,7 @@ if ($settings{'ACTION'} eq '')
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
 my %checked =();     # Checkbox manipulations
+$checked{'SERVICE'}{'all-inkl.com'} = '';
 $checked{'SERVICE'}{'cjb.net'} = '';
 $checked{'SERVICE'}{'dhs.org'} = '';
 $checked{'SERVICE'}{'dnspark.com'} = '';
@@ -327,6 +328,7 @@ print <<END
 <tr>
     <td width='25%' class='base'>$Lang::tr{'service'}:</td>
     <td width='25%'><select size='1' name='SERVICE'>
+    <option $checked{'SERVICE'}{'all-inkl.com'}>all-inkl.com</option>
     <option $checked{'SERVICE'}{'cjb.net'}>cjb.net</option>
     <option $checked{'SERVICE'}{'dhs.org'}>dhs.org</option>
     <option $checked{'SERVICE'}{'dnspark.com'}>dnspark.com</option>
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;