# 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 = '';
# Splitt lines (splitting element is a single ",") and save values into temp array.
@temp = split(/\,/,$line);
+ # Handle hostname details. Only connect the values with a dott if both are available.
+ my $hostname;
+
+ if (($temp[1]) && ($temp[2])) {
+ $hostname = "$temp[1].$temp[2]";
+ } else {
+ $hostname = "$temp[1]";
+ }
+
$settings{'SERVICE'} = $temp[0];
- $settings{'HOSTNAME'} = "$temp[1].$temp[2]";
+ $settings{'HOSTNAME'} = $hostname;
$settings{'PROXY'} = $temp[3];
$settings{'WILDCARDS'} = $temp[4];
$settings{'LOGIN'} = $temp[5];
$col="bgcolor='$color{'color22'}'";
}
+ # Handle hostname details. Only connect the values with a dott if both are available.
+ my $hostname="";
+
+ if (($temp[1]) && ($temp[2])) {
+ $hostname="$temp[1].$temp[2]";
+ } else {
+ $hostname="$temp[1]";
+ }
+
# The following HTML Code still is part of the loop.
print <<END;
<tr>
<td align='center' $col><a href='http://$temp[0]'>$temp[0]</a></td>
- <td align='center' $col>$sync$temp[1].$sync$temp[2]</td>
+ <td align='center' $col>$sync$hostname</td>
<td align='center' $col><form method='post' action='$ENV{'SCRIPT_NAME'}'>
<input type='hidden' name='ID' value='$id'>
# Skip disabled entries.
next unless ($enabled eq "on");
- print FILE "[$hostname.$domain]\n";
+ # Handle hostname details. Only connect the values with a dott if both are available.
+ if (($hostname) && ($domain)) {
+ print FILE "[$hostname.$domain]\n";
+ } else {
+ print FILE "[$hostname]\n";
+ }
+
print FILE "provider = $provider\n";
my $use_token = 0;
# Handle token based auth for various providers.
- if ($provider ~~ ["dns.lightningwirelabs.com", "entrydns.net", "regfish.com"] && $username eq "token") {
+ if ($provider ~~ ["dns.lightningwirelabs.com", "entrydns.net", "regfish.com",
+ "spdns.de", "zzzz.io"] && $username eq "token") {
$use_token = 1;
# Handle token auth for freedns.afraid.org and regfish.com.
print FILE "password = $password\n";
}
- # These providers need to be set to only use IPv4.
- if ($provider ~~ ["freedns.afraid.org", "nsupdate.info", "opendns.com", "variomedia.de", "zoneedit.com"]) {
- print FILE "proto = ipv4\n";
- }
-
print FILE "\n";
}