'keysystems-common-defaults' => { 'server' => setv(T_FQDNP, 1, 0, 1, 'dynamicdns.key-systems.net', undef), 'login' => setv(T_LOGIN, 0, 0, 0, 'unused', undef), },
'keysystems' => { 'updateable' => undef, 'update' => \&nic_keysystems_update, 'examples' => \&nic_keysystems_examples, 'variables' => merge( $variables{'keysystems-common-defaults'}, $variables{'service-common-defaults'}, ), },
######################################################################## nic_keysystems_examples######################################################################sub nic_keysystems_examples { return <<EoEXAMPLE;o 'keysystems'The 'keysystems' protocol is used by the non-freedynamic DNS service offered by www.domaindiscount24.com and www.rrpproxy.net.Check https://www.domaindiscount24.com/faq/en/dynamic-dns for APIConfiguration variables applicable to the 'keysystems' protocol are:protocol=keysystemsserver=dynamicdns.key-systems.netpassword=service-password ## password (token) registered with the servicesubdomain.example.com ## the host registered with the service.Example ${program}.conf file entries:## single host updateprotocol=keysystems, \\\\password=service-password \\\\example.comEoEXAMPLE}######################################################################## nic_keysystems_update## response contains "code 200" on succesfull completion######################################################################sub nic_keysystems_update { debug("\nnic_keysystems_update -------------------"); ## update each configured host ## should improve to update in one pass foreach my $h (@_) { my $ip = delete $config{$h}{'wantip'}; info("KEYSYSTEMS setting IP address to %s for %s", $ip, $h); my $url = "http://$config{$h}{'server'}/update.php?hostname=$h&password=$config{$h}{'password'}&ip=$ip"; # Try to get URL my $reply = geturl(opt('proxy'), $url); # No response, declare as failed if (!defined($reply) || !$reply) { failed("KEYSYSTEMS updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); last; } last if !header_ok($h, $reply); if ($reply =~ /code = 200/) { $config{$h}{'ip'} = $ip; $config{$h}{'mtime'} = $now; $config{$h}{'status'} = 'good'; success("updating %s: good: IP address set to %s", $h, $ip); } else { $config{$h}{'status'} = 'failed'; failed("updating %s: Server said: '$reply'", $h); } }}
Configuration variables applicable to the 'keysystems' protocol are:protocol=keysystemsserver=dynamicdns.key-systems.netpassword=service-password ## password (token) registered with the servicesubdomain.example.com ## the host registered with the service.Example ${program}.conf file entries:## single host updateprotocol=keysystems, \\\\password=service-password \\\\example.com