From 7b1ba6eb2d058cae843a49b5cd87f40221ef7151 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 5 Jun 2024 18:05:31 +0200 Subject: [PATCH 1/2] Change ttl from string to number --- cloudflare-template.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudflare-template.sh b/cloudflare-template.sh index 32cbaa8..0834eaa 100644 --- a/cloudflare-template.sh +++ b/cloudflare-template.sh @@ -6,7 +6,7 @@ auth_method="token" # Set to "global" for Global auth_key="" # Your API Token or Global API Key zone_identifier="" # Can be found in the "Overview" tab of your domain record_name="" # Which record you want to be synced -ttl="3600" # Set the DNS TTL (seconds) +ttl=3600 # Set the DNS TTL (seconds) proxy="false" # Set the proxy to true or false sitename="" # Title of site "Example Site" slackchannel="" # Slack Channel #example @@ -82,7 +82,7 @@ update=$(curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/$zone_iden -H "X-Auth-Email: $auth_email" \ -H "$auth_header $auth_key" \ -H "Content-Type: application/json" \ - --data "{\"type\":\"A\",\"name\":\"$record_name\",\"content\":\"$ip\",\"ttl\":\"$ttl\",\"proxied\":${proxy}}") + --data "{\"type\":\"A\",\"name\":\"$record_name\",\"content\":\"$ip\",\"ttl\":$ttl,\"proxied\":${proxy}}") ########################################### ## Report the status From a24860b6836e88df4152e0052bcb045ccd295d53 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 5 Jun 2024 21:57:29 +0200 Subject: [PATCH 2/2] Change ttl from string to number for v6 --- cloudflare-templatev6.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudflare-templatev6.sh b/cloudflare-templatev6.sh index f393031..54b91f8 100644 --- a/cloudflare-templatev6.sh +++ b/cloudflare-templatev6.sh @@ -18,7 +18,7 @@ zone_identifier="" # @proxy - Set the proxy to true or false # -------------------------------------------------- # record_name="" -ttl="3600" +ttl=3600 proxy="false" ############### SCRIPT CONFIGURATION ############### @@ -143,7 +143,7 @@ update=$(curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/$zone_iden -H "X-Auth-Email: $auth_email" \ -H "$auth_header $auth_key" \ -H "Content-Type: application/json" \ - --data "{\"content\":\"$ip\",\"ttl\":\"$ttl\",\"proxied\":$proxy}") + --data "{\"content\":\"$ip\",\"ttl\":$ttl,\"proxied\":$proxy}") ################################################ ## Report the status