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:
parent
ef566064d5
commit
8ed93cb576
1 changed files with 167 additions and 215 deletions
382
ddclient.in
382
ddclient.in
|
@ -415,106 +415,10 @@ my %variables = (
|
|||
'warned-min-error-interval' => setv(T_ANY, 0, 1, 0, undef),
|
||||
},
|
||||
'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),
|
||||
'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 = (
|
||||
|
@ -522,22 +426,28 @@ my %services = (
|
|||
'updateable' => undef,
|
||||
'update' => \&nic_changeip_update,
|
||||
'examples' => \&nic_changeip_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'nic.changeip.com', undef) },
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')), },
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'nic.changeip.com', undef),
|
||||
},
|
||||
},
|
||||
'cloudflare' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_cloudflare_update,
|
||||
'examples' => \&nic_cloudflare_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'api.cloudflare.com/client/v4', undef) },
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), },
|
||||
$variables{'cloudflare-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
|
||||
'login' => setv(T_LOGIN, 0, 0, 'token', undef),
|
||||
'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' => {
|
||||
'updateable' => undef,
|
||||
|
@ -557,214 +467,256 @@ my %services = (
|
|||
'updateable' => undef,
|
||||
'update' => \&nic_dnsmadeeasy_update,
|
||||
'examples' => \&nic_dnsmadeeasy_examples,
|
||||
'variables' => merge(
|
||||
$variables{'dnsmadeeasy-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'script' => setv(T_STRING, 1, 1, '/servlet/updateip', undef),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'cp.dnsmadeeasy.com', undef),
|
||||
},
|
||||
},
|
||||
'dondominio' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_dondominio_update,
|
||||
'examples' => \&nic_dondominio_examples,
|
||||
'variables' => merge(
|
||||
$variables{'dondominio-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'server' => setv(T_FQDNP, 1, 0, 'dondns.dondominio.com', undef),
|
||||
},
|
||||
},
|
||||
'dslreports1' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_dslreports1_update,
|
||||
'examples' => \&nic_dslreports1_examples,
|
||||
'variables' => merge(
|
||||
{ 'host' => setv(T_NUMBER, 1, 1, 0, undef) },
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'host' => setv(T_NUMBER, 1, 1, 0, undef),
|
||||
},
|
||||
},
|
||||
'dtdns' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_dtdns_update,
|
||||
'examples' => \&nic_dtdns_examples,
|
||||
'variables' => merge(
|
||||
$variables{'dtdns-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'client' => setv(T_STRING, 0, 1, $program, undef),
|
||||
'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
|
||||
},
|
||||
},
|
||||
'duckdns' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_duckdns_update,
|
||||
'examples' => \&nic_duckdns_examples,
|
||||
'variables' => merge(
|
||||
$variables{'duckdns-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'www.duckdns.org', undef),
|
||||
},
|
||||
},
|
||||
'dyndns1' => {
|
||||
'updateable' => \&nic_dyndns2_updateable,
|
||||
'update' => \&nic_dyndns1_update,
|
||||
'examples' => \&nic_dyndns1_examples,
|
||||
'variables' => merge(
|
||||
$variables{'dyndns-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
%{$variables{'dyndns-common-defaults'}},
|
||||
},
|
||||
},
|
||||
'dyndns2' => {
|
||||
'updateable' => \&nic_dyndns2_updateable,
|
||||
'update' => \&nic_dyndns2_update,
|
||||
'examples' => \&nic_dyndns2_examples,
|
||||
'variables' => merge(
|
||||
{ 'custom' => setv(T_BOOL, 0, 1, 0, undef), },
|
||||
{ 'script' => setv(T_STRING, 1, 1, '/nic/update', undef), },
|
||||
$variables{'dyndns-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
%{$variables{'dyndns-common-defaults'}},
|
||||
'custom' => setv(T_BOOL, 0, 1, 0, undef),
|
||||
'script' => setv(T_STRING, 1, 1, '/nic/update', undef),
|
||||
},
|
||||
},
|
||||
'easydns' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_easydns_update,
|
||||
'examples' => \&nic_easydns_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'members.easydns.com', undef) },
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), },
|
||||
$variables{'easydns-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'backupmx' => setv(T_BOOL, 0, 1, 0, undef),
|
||||
'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
|
||||
'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' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_freedns_update,
|
||||
'examples' => \&nic_freedns_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'freedns.afraid.org', undef) },
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')), },
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'freedns.afraid.org', undef),
|
||||
},
|
||||
},
|
||||
'freemyip' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_freemyip_update,
|
||||
'examples' => \&nic_freemyip_examples,
|
||||
'variables' => merge(
|
||||
$variables{'freemyip-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'login' => setv(T_LOGIN, 0, 0, 'unused', undef),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'freemyip.com', undef),
|
||||
},
|
||||
},
|
||||
'googledomains' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_googledomains_update,
|
||||
'examples' => \&nic_googledomains_examples,
|
||||
'variables' => merge(
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), },
|
||||
$variables{'googledomains-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'domains.google.com', undef),
|
||||
},
|
||||
},
|
||||
'hammernode1' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_hammernode1_update,
|
||||
'examples' => \&nic_hammernode1_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'dup.hn.org', undef) },
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), },
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'dup.hn.org', undef),
|
||||
},
|
||||
},
|
||||
'namecheap' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_namecheap_update,
|
||||
'examples' => \&nic_namecheap_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'dynamicdns.park-your-domain.com', undef) },
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')), },
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'dynamicdns.park-your-domain.com', undef),
|
||||
},
|
||||
},
|
||||
'nfsn' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_nfsn_update,
|
||||
'examples' => \&nic_nfsn_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'api.nearlyfreespeech.net', undef) },
|
||||
{ 'min_interval' => setv(T_FQDNP, 0, 0, 0, interval('5m')) },
|
||||
{ 'ttl' => setv(T_NUMBER, 1, 0, 300, undef) },
|
||||
{ 'zone' => setv(T_FQDN, 1, 0, undef, undef) },
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'min_interval' => setv(T_FQDNP, 0, 0, 0, interval('5m')),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'api.nearlyfreespeech.net', undef),
|
||||
'ttl' => setv(T_NUMBER, 1, 0, 300, undef),
|
||||
'zone' => setv(T_FQDN, 1, 0, undef, undef),
|
||||
},
|
||||
},
|
||||
'noip' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_noip_update,
|
||||
'examples' => \&nic_noip_examples,
|
||||
'variables' => merge(
|
||||
{ 'custom' => setv(T_BOOL, 0, 1, 0, undef), },
|
||||
$variables{'noip-common-defaults'},
|
||||
$variables{'noip-service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
'atime' => setv(T_NUMBER, 0, 1, 0, undef),
|
||||
'custom' => setv(T_BOOL, 0, 1, 0, undef),
|
||||
'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' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_nsupdate_update,
|
||||
'examples' => \&nic_nsupdate_examples,
|
||||
'variables' => merge(
|
||||
{ 'login' => setv(T_LOGIN, 1, 0, '/usr/bin/nsupdate', undef), },
|
||||
$variables{'nsupdate-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'login' => setv(T_LOGIN, 1, 0, '/usr/bin/nsupdate', undef),
|
||||
'tcp' => setv(T_BOOL, 0, 1, 0, undef),
|
||||
'ttl' => setv(T_NUMBER, 0, 1, 600, undef),
|
||||
'zone' => setv(T_STRING, 1, 1, '', undef),
|
||||
},
|
||||
},
|
||||
'ovh' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_ovh_update,
|
||||
'examples' => \&nic_ovh_examples,
|
||||
'variables' => merge(
|
||||
$variables{'ovh-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$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' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_sitelutions_update,
|
||||
'examples' => \&nic_sitelutions_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'www.sitelutions.com', undef) },
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')), },
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'server' => setv(T_FQDNP, 1, 0, 'www.sitelutions.com', undef),
|
||||
'min-interval' => setv(T_DELAY, 0, 0, 0, interval('5m')),
|
||||
},
|
||||
},
|
||||
'woima' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_woima_update,
|
||||
'examples' => \&nic_woima_examples,
|
||||
'variables' => merge(
|
||||
$variables{'woima-common-defaults'},
|
||||
$variables{'woima-service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
'atime' => setv(T_NUMBER, 0, 1, 0, undef),
|
||||
'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' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_yandex_update,
|
||||
'examples' => \&nic_yandex_examples,
|
||||
'variables' => merge(
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), },
|
||||
$variables{'yandex-common-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'pddimp.yandex.ru', undef),
|
||||
},
|
||||
},
|
||||
'zoneedit1' => {
|
||||
'updateable' => undef,
|
||||
'update' => \&nic_zoneedit1_update,
|
||||
'examples' => \&nic_zoneedit1_examples,
|
||||
'variables' => merge(
|
||||
{ 'server' => setv(T_FQDNP, 1, 0, 'dynamic.zoneedit.com', undef) },
|
||||
{ 'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0), },
|
||||
$variables{'service-common-defaults'},
|
||||
$variables{'zoneedit-service-common-defaults'},
|
||||
),
|
||||
'variables' => {
|
||||
%{$variables{'service-common-defaults'}},
|
||||
'min-interval' => setv(T_DELAY, 0, 0, interval('5m'), 0),
|
||||
'server' => setv(T_FQDNP, 1, 0, 'dynamic.zoneedit.com', undef),
|
||||
'zone' => setv(T_OFQDN, 0, 0, undef, undef),
|
||||
},
|
||||
},
|
||||
);
|
||||
$variables{'merged'} = merge($variables{'global-defaults'},
|
||||
$variables{'service-common-defaults'},
|
||||
$variables{'dyndns-common-defaults'},
|
||||
map { $services{$_}{'variables'} } keys %services,
|
||||
);
|
||||
$variables{'merged'} = {
|
||||
map({ %{$services{$_}{'variables'}} } keys(%services)),
|
||||
%{$variables{'dyndns-common-defaults'}},
|
||||
%{$variables{'service-common-defaults'}},
|
||||
%{$variables{'global-defaults'}},
|
||||
};
|
||||
|
||||
# This will hold the processed args.
|
||||
my %opt = ();
|
||||
|
|
Loading…
Reference in a new issue