From 4d1b3439ead0c7ec3e4487ec5de414d5ff590112 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sat, 18 May 2024 21:05:57 -0400 Subject: [PATCH] Use `service-common-defaults` variables This avoids a lot of duplication and improves readability by making it easier to see service-specific variables. --- ddclient.in | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/ddclient.in b/ddclient.in index faecf6d..d254141 100755 --- a/ddclient.in +++ b/ddclient.in @@ -963,15 +963,13 @@ my %services = ( 'update' => \&nic_porkbun_update, 'examples' => \&nic_porkbun_examples, 'variables' => { + %{$variables{'service-common-defaults'}}, 'apikey' => setv(T_PASSWD, 1, 0, '', undef), 'secretapikey' => setv(T_PASSWD, 1, 0, '', undef), 'root-domain' => setv(T_OFQDN, 0, 0, '', undef), 'on-root-domain' => setv(T_BOOL, 0, 0, 0, undef), 'login' => setv(T_LOGIN, 0, 0, 'unused', undef), 'password' => setv(T_PASSWD, 0, 0, 'unused', undef), - 'use' => setv(T_USE, 0, 0, 'disabled', undef), - 'usev4' => setv(T_USEV4, 0, 0, 'disabled', undef), - 'usev6' => setv(T_USEV6, 0, 0, 'disabled', undef), }, }, 'sitelutions' => { @@ -989,25 +987,14 @@ my %services = ( 'update' => \&nic_woima_update, 'examples' => \&nic_woima_examples, 'variables' => { - 'atime' => setv(T_NUMBER, 0, 1, 0, undef), + %{$variables{'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' => {