]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/ddns.cgi
Fix for bug 12539
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / ddns.cgi
index 3e6f72f987838359e4d740111fc878b67d0400d0..024eaf7f676ade08718f3984cacb30800f723635 100644 (file)
@@ -20,6 +20,7 @@
 ###############################################################################
 
 use strict;
+use experimental 'smartmatch';
 
 # enable only the following on debugging purpose
 #use warnings;
@@ -44,10 +45,8 @@ my $settingsfile = "${General::swroot}/ddns/settings";
 # Config file to store the configured ddns providers.
 my $datafile = "${General::swroot}/ddns/config";
 
-# Dynamic ddns programm call.
-my @ddnsprog = ("/usr/bin/ddns", "--config",
-               "/var/ipfire/ddns/ddns.conf",
-               "update-all");
+# Call the ddnsctrl helper binary to perform the update.
+my @ddnsprog = ("/usr/local/bin/ddnsctrl", "update-all");
 
 my %settings=();
 my $errormessage = '';
@@ -666,13 +665,13 @@ sub GenerateDDNSConfigFile {
 
                my $use_token = 0;
 
-               # Handle token based auth for various providers.
-               if ($provider ~~ ["dns.lightningwirelabs.com", "entrydns.net", "regfish.com",
-                                 "spdns.de", "zzzz.io"] && $username eq "token") {
+               # Check if token based auth is configured.
+               if ($username eq "token") {
                        $use_token = 1;
+               }
 
                # Handle token auth for freedns.afraid.org and regfish.com.
-               } elsif ($provider ~~ ["freedns.afraid.org", "regfish.com"] && $password eq "") {
+               if ($provider ~~ ["freedns.afraid.org", "regfish.com"] && $password eq "") {
                        $use_token = 1;
                        $password = $username;