From 95fd3c1bc3abfbb17cdfb1948c205da0e9727643 Mon Sep 17 00:00:00 2001 From: gertfriend Date: Fri, 28 Oct 2022 00:25:52 +0200 Subject: [PATCH] Update ddclient.in --- ddclient.in | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/ddclient.in b/ddclient.in index 05bafc3..ce50795 100755 --- a/ddclient.in +++ b/ddclient.in @@ -533,6 +533,10 @@ my %variables = ( 'script' => setv(T_STRING, 0, 1, '/RemoteUpdate.sv', undef), 'min-error-interval' => setv(T_DELAY, 0, 0, interval('8m'), 0), }, + 'regfishde-common-defaults' => { + 'server' => setv(T_FQDNP, 1, 0, 'dyndns.regfish.de', undef), + 'login' => setv(T_LOGIN, 0, 0, 0, 'unused', undef), + }, ); my %services = ( '1984' => { @@ -895,6 +899,15 @@ my %services = ( $variables{'service-common-defaults'}, ), }, + 'regfishde' => { + 'updateable' => undef, + 'update' => \&nic_regfishdev4_update, + 'examples' => \&nic_regfishdev4_examples, + 'variables' => merge( + $variables{'regfishde-common-defaults'}, + $variables{'service-common-defaults'}, + ), + }, ); $variables{'merged'} = { map({ %{$services{$_}{'variables'}} } keys(%services)), @@ -7162,6 +7175,65 @@ sub nic_keysystems_update { } } +###################################################################### +## nic_regfishdev4_examples +###################################################################### +sub nic_regfishdev4_examples { + return < opt('proxy'), url => $url); + + # No response, declare as failed + if (!defined($reply) || !$reply) { + failed("regfish.de updating %s: Could not connect to %s.", $h, $config{$h}{'server'}); + last; + } + last if !header_ok($h, $reply); + + if ($reply =~ /success/) + { + $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); + } + } +} # Execute main() if this file is run as a script or run via PAR (https://metacpan.org/pod/PAR), # otherwise do nothing. This "modulino" pattern makes it possible to import this file as a module