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.

git-svn-id: svn+ssh://svn.code.sf.net/p/ddclient/code/trunk@195 3873ddee-7413-0410-b6c4-c2c57c1ab35a
This commit is contained in:
wimpunk 2015-10-13 20:26:00 +00:00
parent 017f04b500
commit 5bea1a58f7
2 changed files with 5 additions and 2 deletions

View file

@ -445,6 +445,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),
@ -4186,7 +4187,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
##