DynDNS2: Set ipv6 argument

This commit is contained in:
Sandro Jäckel 2019-12-29 05:08:33 +01:00
parent b628eeb65a
commit aea03be92f
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -3015,13 +3015,21 @@ sub nic_dyndns2_update {
my $hosts = join(',', @hosts); my $hosts = join(',', @hosts);
my $h = $hosts[0]; my $h = $hosts[0];
my $ip = $config{$h}{'wantip'}; my $ip = $config{$h}{'wantip'};
my $ipv6 = $config{$h}{'wantipv6'};
delete $config{$_}{'wantip'} foreach @hosts; delete $config{$_}{'wantip'} foreach @hosts;
delete $config{$_}{'wantipv6'} foreach @hosts;
info("setting IP address to %s for %s", $ip, $hosts); info("setting IP address to %s for %s", $ip, $hosts);
verbose("UPDATE:","updating %s", $hosts); verbose("UPDATE:","updating %s", $hosts);
my $prot = "http";
my $use_ssl;
if ($use_ssl || $globals{'ssl'}) {
$prot = "https";
}
## Select the DynDNS system to update ## Select the DynDNS system to update
my $url = "http://$config{$h}{'server'}$config{$h}{'script'}?system="; my $url = "$prot://$config{$h}{'server'}$config{$h}{'script'}?system=";
if ($config{$h}{'custom'}) { if ($config{$h}{'custom'}) {
warning("updating %s: 'custom' and 'static' may not be used together. ('static' ignored)", $hosts) warning("updating %s: 'custom' and 'static' may not be used together. ('static' ignored)", $hosts)
if $config{$h}{'static'}; if $config{$h}{'static'};
@ -3042,6 +3050,11 @@ sub nic_dyndns2_update {
$url .= "&myip="; $url .= "&myip=";
$url .= $ip if $ip; $url .= $ip if $ip;
if ($ipv6) {
$url .= "&myipv6=";
$url .= $ipv6;
}
## some args are not valid for a custom domain. ## some args are not valid for a custom domain.
$url .= "&wildcard=ON" if ynu($config{$h}{'wildcard'}, 1, 0, 0); $url .= "&wildcard=ON" if ynu($config{$h}{'wildcard'}, 1, 0, 0);
if ($config{$h}{'mx'}) { if ($config{$h}{'mx'}) {