Merge pull request #25 from dancapper/master

Adding configurable TTL to Cloudflare

This change adds configurable TTL to cloudflare instead of just using hardcoded value of 1 which sets "automatic" TTL any time ddclient updates the IP address.
This commit is contained in:
wimpunk 2015-09-30 21:45:22 +02:00
commit 59147f662b
2 changed files with 5 additions and 2 deletions

View file

@ -443,6 +443,7 @@ my %variables = (
'wildcard' => setv(T_BOOL, 0, 1, 1, 0, undef),
'mx' => setv(T_OFQDN, 0, 1, 1, '', undef),
'backupmx' => setv(T_BOOL, 0, 1, 1, 0, undef),
'ttl' => setv(T_NUMBER, 1, 0, 1, 1, undef),
},
'googledomains-common-defaults' => {
'server' => setv(T_FQDNP, 1, 0, 1, 'domains.google.com', undef),
@ -4139,7 +4140,8 @@ sub nic_cloudflare_update {
}
# Set domain
$url = "https://$config{$key}{'server'}/api_json.html?a=rec_edit&type=A&ttl=1";
$url = "https://$config{$key}{'server'}/api_json.html?a=rec_edit&type=A";
$url .= "&ttl=".$config{$key}{'ttl'};
$url .= "&name=$hostname";
$url .= "&z=".$config{$key}{'zone'};
$url .= "&id=".$id;

View file

@ -202,7 +202,8 @@ ssl=yes # use ssl-support. Works with
#zone=domain.tld, \
#server=www.cloudflare.com, \
#login=your-login-email, \
#password=APIKey \
#password=APIKey, \
#ttl=1 \
#domain.tld,my.domain.tld
##