Move per-service variables to the service definitions

Most of the entries in `%variables` are only used once. Move them down
to their respective service definitions.

Also:
  * Use idiomatic hash merging instead of `merge()`.
  * Sort the variables by name.
This commit is contained in:
Richard Hansen 2020-06-26 12:46:31 -04:00
parent ef566064d5
commit 8ed93cb576

View file

@ -415,106 +415,10 @@ my %variables = (
'warned-min-error-interval' => setv(T_ANY, 0, 1, 0, undef), 'warned-min-error-interval' => setv(T_ANY, 0, 1, 0, undef),
}, },
'dyndns-common-defaults' => { 'dyndns-common-defaults' => {
'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
'mx' => setv(T_OFQDN, 0, 1, '', undef),
'static' => setv(T_BOOL, 0, 1, 0, undef), 'static' => setv(T_BOOL, 0, 1, 0, undef),
'wildcard' => setv(T_BOOL, 0, 1, 0, undef), 'wildcard' => setv(T_BOOL, 0, 1, 0, undef),
'mx' => setv(T_OFQDN, 0, 1, '', undef),
'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
},
'easydns-common-defaults' => {
'wildcard' => setv(T_BOOL, 0, 1, 0, undef),
'mx' => setv(T_OFQDN, 0, 1, '', undef),
'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
},
'noip-common-defaults' => {
'static' => setv(T_BOOL, 0, 1, 0, undef),
},
'noip-service-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'dynupdate.no-ip.com',undef),
'login' => setv(T_LOGIN, 1, 0, '', undef),
'password' => setv(T_PASSWD,1, 0, '', undef),
'host' => setv(T_STRING,1, 1, '', undef),
'ip' => setv(T_IP, 0, 1, undef, undef),
'wtime' => setv(T_DELAY, 0, 1, 0, interval('30s')),
'mtime' => setv(T_NUMBER,0, 1, 0, undef),
'atime' => setv(T_NUMBER,0, 1, 0, undef),
'status' => setv(T_ANY, 0, 1, '', undef),
'min-interval' => setv(T_DELAY, 0, 0, interval('30s'), 0),
'max-interval' => setv(T_DELAY, 0, 0, interval('25d'), 0),
'min-error-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
'warned-min-interval' => setv(T_ANY, 0, 1, 0, undef),
'warned-min-error-interval' => setv(T_ANY, 0, 1, 0, undef),
},
'zoneedit-service-common-defaults' => {
'zone' => setv(T_OFQDN, 0, 0, undef, undef),
},
'dtdns-common-defaults' => {
'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
'client' => setv(T_STRING,0, 1, $program, undef),
},
'nsupdate-common-defaults' => {
'ttl' => setv(T_NUMBER,0, 1, 600, undef),
'zone' => setv(T_STRING,1, 1, '', undef),
'tcp' => setv(T_BOOL, 0, 1, 0, undef),
},
'cloudflare-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'api.cloudflare.com/client/v4', undef),
'zone' => setv(T_FQDN, 1, 0, '', undef),
'login' => setv(T_LOGIN, 0, 0, 'token', undef),
'static' => setv(T_BOOL, 0, 1, 0, undef),
'wildcard' => setv(T_BOOL, 0, 1, 0, undef),
'mx' => setv(T_OFQDN, 0, 1, '', undef),
'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
'ttl' => setv(T_NUMBER,1, 0, 1, undef),
},
'googledomains-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'domains.google.com', undef),
},
'duckdns-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'www.duckdns.org', undef),
'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
},
'freemyip-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'freemyip.com', undef),
'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
},
'woima-common-defaults' => {
'static' => setv(T_BOOL, 0, 1, 0, undef),
'wildcard' => setv(T_BOOL, 0, 1, 0, undef),
'mx' => setv(T_OFQDN, 0, 1, '', undef),
'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
'custom' => setv(T_BOOL, 0, 1, 0, undef),
'script' => setv(T_STRING,1, 1, '/nic/update', undef),
},
'woima-service-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'dyn.woima.fi', undef),
'login' => setv(T_LOGIN, 1, 0, '', undef),
'password' => setv(T_PASSWD,1, 0, '', undef),
'ip' => setv(T_IP, 0, 1, undef, undef),
'wtime' => setv(T_DELAY, 0, 1, 0, interval('30s')),
'mtime' => setv(T_NUMBER,0, 1, 0, undef),
'atime' => setv(T_NUMBER,0, 1, 0, undef),
'status' => setv(T_ANY, 0, 1, '', undef),
'min-interval' => setv(T_DELAY, 0, 0, interval('30s'), 0),
'max-interval' => setv(T_DELAY, 0, 0, interval('25d'), 0),
'min-error-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
'warned-min-interval' => setv(T_ANY, 0, 1, 0, undef),
'warned-min-error-interval' => setv(T_ANY, 0, 1, 0, undef),
},
'yandex-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'pddimp.yandex.ru', undef),
},
'dnsmadeeasy-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'cp.dnsmadeeasy.com', undef),
'script' => setv(T_STRING,1, 1, '/servlet/updateip', undef),
},
'dondominio-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'dondns.dondominio.com', undef),
},
'ovh-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 'www.ovh.com', undef),
'script' => setv(T_STRING,1, 1, '/nic/update', undef),
'login' => setv(T_LOGIN, 1, 0, '', undef),
'password' => setv(T_PASSWD,1, 0, '', undef),
}, },
); );
my %services = ( my %services = (
@ -522,22 +426,28 @@ my %services = (
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_changeip_update, 'update' => \&nic_changeip_update,
'examples' => \&nic_changeip_examples, 'examples' => \&nic_changeip_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'nic.changeip.com', undef) }, %{$variables{'service-common-defaults'}},
{ 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')), }, 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')),
$variables{'service-common-defaults'}, 'server' => setv(T_FQDNP, 1, 0, 'nic.changeip.com', undef),
), },
}, },
'cloudflare' => { 'cloudflare' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_cloudflare_update, 'update' => \&nic_cloudflare_update,
'examples' => \&nic_cloudflare_examples, 'examples' => \&nic_cloudflare_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'api.cloudflare.com/client/v4', undef) }, %{$variables{'service-common-defaults'}},
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), }, 'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
$variables{'cloudflare-common-defaults'}, 'login' => setv(T_LOGIN, 0, 0, 'token', undef),
$variables{'service-common-defaults'}, 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
), 'mx' => setv(T_OFQDN, 0, 1, '', undef),
'server' => setv(T_FQDNP, 1, 0, 'api.cloudflare.com/client/v4', undef),
'static' => setv(T_BOOL, 0, 1, 0, undef),
'ttl' => setv(T_NUMBER, 1, 0, 1, undef),
'wildcard' => setv(T_BOOL, 0, 1, 0, undef),
'zone' => setv(T_FQDN, 1, 0, '', undef),
},
}, },
'cloudns' => { 'cloudns' => {
'updateable' => undef, 'updateable' => undef,
@ -557,214 +467,256 @@ my %services = (
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_dnsmadeeasy_update, 'update' => \&nic_dnsmadeeasy_update,
'examples' => \&nic_dnsmadeeasy_examples, 'examples' => \&nic_dnsmadeeasy_examples,
'variables' => merge( 'variables' => {
$variables{'dnsmadeeasy-common-defaults'}, %{$variables{'service-common-defaults'}},
$variables{'service-common-defaults'}, 'script' => setv(T_STRING, 1, 1, '/servlet/updateip', undef),
), 'server' => setv(T_FQDNP, 1, 0, 'cp.dnsmadeeasy.com', undef),
},
}, },
'dondominio' => { 'dondominio' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_dondominio_update, 'update' => \&nic_dondominio_update,
'examples' => \&nic_dondominio_examples, 'examples' => \&nic_dondominio_examples,
'variables' => merge( 'variables' => {
$variables{'dondominio-common-defaults'}, %{$variables{'service-common-defaults'}},
$variables{'service-common-defaults'}, 'server' => setv(T_FQDNP, 1, 0, 'dondns.dondominio.com', undef),
), },
}, },
'dslreports1' => { 'dslreports1' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_dslreports1_update, 'update' => \&nic_dslreports1_update,
'examples' => \&nic_dslreports1_examples, 'examples' => \&nic_dslreports1_examples,
'variables' => merge( 'variables' => {
{ 'host' => setv(T_NUMBER, 1, 1, 0, undef) }, %{$variables{'service-common-defaults'}},
$variables{'service-common-defaults'}, 'host' => setv(T_NUMBER, 1, 1, 0, undef),
), },
}, },
'dtdns' => { 'dtdns' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_dtdns_update, 'update' => \&nic_dtdns_update,
'examples' => \&nic_dtdns_examples, 'examples' => \&nic_dtdns_examples,
'variables' => merge( 'variables' => {
$variables{'dtdns-common-defaults'}, %{$variables{'service-common-defaults'}},
$variables{'service-common-defaults'}, 'client' => setv(T_STRING, 0, 1, $program, undef),
), 'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
},
}, },
'duckdns' => { 'duckdns' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_duckdns_update, 'update' => \&nic_duckdns_update,
'examples' => \&nic_duckdns_examples, 'examples' => \&nic_duckdns_examples,
'variables' => merge( 'variables' => {
$variables{'duckdns-common-defaults'}, %{$variables{'service-common-defaults'}},
$variables{'service-common-defaults'}, 'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
), 'server' => setv(T_FQDNP, 1, 0, 'www.duckdns.org', undef),
},
}, },
'dyndns1' => { 'dyndns1' => {
'updateable' => \&nic_dyndns2_updateable, 'updateable' => \&nic_dyndns2_updateable,
'update' => \&nic_dyndns1_update, 'update' => \&nic_dyndns1_update,
'examples' => \&nic_dyndns1_examples, 'examples' => \&nic_dyndns1_examples,
'variables' => merge( 'variables' => {
$variables{'dyndns-common-defaults'}, %{$variables{'service-common-defaults'}},
$variables{'service-common-defaults'}, %{$variables{'dyndns-common-defaults'}},
), },
}, },
'dyndns2' => { 'dyndns2' => {
'updateable' => \&nic_dyndns2_updateable, 'updateable' => \&nic_dyndns2_updateable,
'update' => \&nic_dyndns2_update, 'update' => \&nic_dyndns2_update,
'examples' => \&nic_dyndns2_examples, 'examples' => \&nic_dyndns2_examples,
'variables' => merge( 'variables' => {
{ 'custom' => setv(T_BOOL, 0, 1, 0, undef), }, %{$variables{'service-common-defaults'}},
{ 'script' => setv(T_STRING, 1, 1, '/nic/update', undef), }, %{$variables{'dyndns-common-defaults'}},
$variables{'dyndns-common-defaults'}, 'custom' => setv(T_BOOL, 0, 1, 0, undef),
$variables{'service-common-defaults'}, 'script' => setv(T_STRING, 1, 1, '/nic/update', undef),
), },
}, },
'easydns' => { 'easydns' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_easydns_update, 'update' => \&nic_easydns_update,
'examples' => \&nic_easydns_examples, 'examples' => \&nic_easydns_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'members.easydns.com', undef) }, %{$variables{'service-common-defaults'}},
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), }, 'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
$variables{'easydns-common-defaults'}, 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
$variables{'service-common-defaults'}, 'mx' => setv(T_OFQDN, 0, 1, '', undef),
), 'server' => setv(T_FQDNP, 1, 0, 'members.easydns.com', undef),
'wildcard' => setv(T_BOOL, 0, 1, 0, undef),
},
}, },
'freedns' => { 'freedns' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_freedns_update, 'update' => \&nic_freedns_update,
'examples' => \&nic_freedns_examples, 'examples' => \&nic_freedns_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'freedns.afraid.org', undef) }, %{$variables{'service-common-defaults'}},
{ 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')), }, 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')),
$variables{'service-common-defaults'}, 'server' => setv(T_FQDNP, 1, 0, 'freedns.afraid.org', undef),
), },
}, },
'freemyip' => { 'freemyip' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_freemyip_update, 'update' => \&nic_freemyip_update,
'examples' => \&nic_freemyip_examples, 'examples' => \&nic_freemyip_examples,
'variables' => merge( 'variables' => {
$variables{'freemyip-common-defaults'}, %{$variables{'service-common-defaults'}},
$variables{'service-common-defaults'}, 'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
), 'server' => setv(T_FQDNP, 1, 0, 'freemyip.com', undef),
},
}, },
'googledomains' => { 'googledomains' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_googledomains_update, 'update' => \&nic_googledomains_update,
'examples' => \&nic_googledomains_examples, 'examples' => \&nic_googledomains_examples,
'variables' => merge( 'variables' => {
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), }, %{$variables{'service-common-defaults'}},
$variables{'googledomains-common-defaults'}, 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
$variables{'service-common-defaults'}, 'server' => setv(T_FQDNP, 1, 0, 'domains.google.com', undef),
), },
}, },
'hammernode1' => { 'hammernode1' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_hammernode1_update, 'update' => \&nic_hammernode1_update,
'examples' => \&nic_hammernode1_examples, 'examples' => \&nic_hammernode1_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'dup.hn.org', undef) }, %{$variables{'service-common-defaults'}},
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), }, 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
$variables{'service-common-defaults'}, 'server' => setv(T_FQDNP, 1, 0, 'dup.hn.org', undef),
), },
}, },
'namecheap' => { 'namecheap' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_namecheap_update, 'update' => \&nic_namecheap_update,
'examples' => \&nic_namecheap_examples, 'examples' => \&nic_namecheap_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'dynamicdns.park-your-domain.com', undef) }, %{$variables{'service-common-defaults'}},
{ 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')), }, 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')),
$variables{'service-common-defaults'}, 'server' => setv(T_FQDNP, 1, 0, 'dynamicdns.park-your-domain.com', undef),
), },
}, },
'nfsn' => { 'nfsn' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_nfsn_update, 'update' => \&nic_nfsn_update,
'examples' => \&nic_nfsn_examples, 'examples' => \&nic_nfsn_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'api.nearlyfreespeech.net', undef) }, %{$variables{'service-common-defaults'}},
{ 'min_interval' => setv(T_FQDNP, 0, 0, 0, interval('5m')) }, 'min_interval' => setv(T_FQDNP, 0, 0, 0, interval('5m')),
{ 'ttl' => setv(T_NUMBER, 1, 0, 300, undef) }, 'server' => setv(T_FQDNP, 1, 0, 'api.nearlyfreespeech.net', undef),
{ 'zone' => setv(T_FQDN, 1, 0, undef, undef) }, 'ttl' => setv(T_NUMBER, 1, 0, 300, undef),
$variables{'service-common-defaults'}, 'zone' => setv(T_FQDN, 1, 0, undef, undef),
), },
}, },
'noip' => { 'noip' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_noip_update, 'update' => \&nic_noip_update,
'examples' => \&nic_noip_examples, 'examples' => \&nic_noip_examples,
'variables' => merge( 'variables' => {
{ 'custom' => setv(T_BOOL, 0, 1, 0, undef), }, 'atime' => setv(T_NUMBER, 0, 1, 0, undef),
$variables{'noip-common-defaults'}, 'custom' => setv(T_BOOL, 0, 1, 0, undef),
$variables{'noip-service-common-defaults'}, 'host' => setv(T_STRING, 1, 1, '', undef),
), 'ip' => setv(T_IP, 0, 1, undef, undef),
'login' => setv(T_LOGIN, 1, 0, '', undef),
'max-interval' => setv(T_DELAY, 0, 0, interval('25d'), 0),
'min-error-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
'min-interval' => setv(T_DELAY, 0, 0, interval('30s'), 0),
'mtime' => setv(T_NUMBER, 0, 1, 0, undef),
'password' => setv(T_PASSWD, 1, 0, '', undef),
'server' => setv(T_FQDNP, 1, 0, 'dynupdate.no-ip.com', undef),
'static' => setv(T_BOOL, 0, 1, 0, undef),
'status' => setv(T_ANY, 0, 1, '', undef),
'warned-min-error-interval' => setv(T_ANY, 0, 1, 0, undef),
'warned-min-interval' => setv(T_ANY, 0, 1, 0, undef),
'wtime' => setv(T_DELAY, 0, 1, 0, interval('30s')),
},
}, },
'nsupdate' => { 'nsupdate' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_nsupdate_update, 'update' => \&nic_nsupdate_update,
'examples' => \&nic_nsupdate_examples, 'examples' => \&nic_nsupdate_examples,
'variables' => merge( 'variables' => {
{ 'login' => setv(T_LOGIN, 1, 0, '/usr/bin/nsupdate', undef), }, %{$variables{'service-common-defaults'}},
$variables{'nsupdate-common-defaults'}, 'login' => setv(T_LOGIN, 1, 0, '/usr/bin/nsupdate', undef),
$variables{'service-common-defaults'}, 'tcp' => setv(T_BOOL, 0, 1, 0, undef),
), 'ttl' => setv(T_NUMBER, 0, 1, 600, undef),
'zone' => setv(T_STRING, 1, 1, '', undef),
},
}, },
'ovh' => { 'ovh' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_ovh_update, 'update' => \&nic_ovh_update,
'examples' => \&nic_ovh_examples, 'examples' => \&nic_ovh_examples,
'variables' => merge( 'variables' => {
$variables{'ovh-common-defaults'}, %{$variables{'service-common-defaults'}},
$variables{'service-common-defaults'}, 'login' => setv(T_LOGIN, 1, 0, '', undef),
), 'password' => setv(T_PASSWD, 1, 0, '', undef),
'script' => setv(T_STRING, 1, 1, '/nic/update', undef),
'server' => setv(T_FQDNP, 1, 0, 'www.ovh.com', undef),
},
}, },
'sitelutions' => { 'sitelutions' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_sitelutions_update, 'update' => \&nic_sitelutions_update,
'examples' => \&nic_sitelutions_examples, 'examples' => \&nic_sitelutions_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'www.sitelutions.com', undef) }, %{$variables{'service-common-defaults'}},
{ 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')), }, 'server' => setv(T_FQDNP, 1, 0, 'www.sitelutions.com', undef),
$variables{'service-common-defaults'}, 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')),
), },
}, },
'woima' => { 'woima' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_woima_update, 'update' => \&nic_woima_update,
'examples' => \&nic_woima_examples, 'examples' => \&nic_woima_examples,
'variables' => merge( 'variables' => {
$variables{'woima-common-defaults'}, 'atime' => setv(T_NUMBER, 0, 1, 0, undef),
$variables{'woima-service-common-defaults'}, 'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
), 'custom' => setv(T_BOOL, 0, 1, 0, undef),
'ip' => setv(T_IP, 0, 1, undef, undef),
'login' => setv(T_LOGIN, 1, 0, '', undef),
'max-interval' => setv(T_DELAY, 0, 0, interval('25d'), 0),
'min-error-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
'min-interval' => setv(T_DELAY, 0, 0, interval('30s'), 0),
'mtime' => setv(T_NUMBER, 0, 1, 0, undef),
'mx' => setv(T_OFQDN, 0, 1, '', undef),
'password' => setv(T_PASSWD, 1, 0, '', undef),
'script' => setv(T_STRING, 1, 1, '/nic/update', undef),
'server' => setv(T_FQDNP, 1, 0, 'dyn.woima.fi', undef),
'static' => setv(T_BOOL, 0, 1, 0, undef),
'status' => setv(T_ANY, 0, 1, '', undef),
'warned-min-error-interval' => setv(T_ANY, 0, 1, 0, undef),
'warned-min-interval' => setv(T_ANY, 0, 1, 0, undef),
'wildcard' => setv(T_BOOL, 0, 1, 0, undef),
'wtime' => setv(T_DELAY, 0, 1, 0, interval('30s')),
},
}, },
'yandex' => { 'yandex' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_yandex_update, 'update' => \&nic_yandex_update,
'examples' => \&nic_yandex_examples, 'examples' => \&nic_yandex_examples,
'variables' => merge( 'variables' => {
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), }, %{$variables{'service-common-defaults'}},
$variables{'yandex-common-defaults'}, 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
$variables{'service-common-defaults'}, 'server' => setv(T_FQDNP, 1, 0, 'pddimp.yandex.ru', undef),
), },
}, },
'zoneedit1' => { 'zoneedit1' => {
'updateable' => undef, 'updateable' => undef,
'update' => \&nic_zoneedit1_update, 'update' => \&nic_zoneedit1_update,
'examples' => \&nic_zoneedit1_examples, 'examples' => \&nic_zoneedit1_examples,
'variables' => merge( 'variables' => {
{ 'server' => setv(T_FQDNP, 1, 0, 'dynamic.zoneedit.com', undef) }, %{$variables{'service-common-defaults'}},
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), }, 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
$variables{'service-common-defaults'}, 'server' => setv(T_FQDNP, 1, 0, 'dynamic.zoneedit.com', undef),
$variables{'zoneedit-service-common-defaults'}, 'zone' => setv(T_OFQDN, 0, 0, undef, undef),
), },
}, },
); );
$variables{'merged'} = merge($variables{'global-defaults'}, $variables{'merged'} = {
$variables{'service-common-defaults'}, map({ %{$services{$_}{'variables'}} } keys(%services)),
$variables{'dyndns-common-defaults'}, %{$variables{'dyndns-common-defaults'}},
map { $services{$_}{'variables'} } keys %services, %{$variables{'service-common-defaults'}},
); %{$variables{'global-defaults'}},
};
# This will hold the processed args. # This will hold the processed args.
my %opt = (); my %opt = ();