From fde4b010aadc2b65d8473204d8445da1b6af8817 Mon Sep 17 00:00:00 2001 From: Luke Cotton Date: Wed, 7 Feb 2024 11:39:51 +0000 Subject: [PATCH] Add maximum TTL --- cloudflare-ddns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudflare-ddns.py b/cloudflare-ddns.py index 1d56863..531f937 100755 --- a/cloudflare-ddns.py +++ b/cloudflare-ddns.py @@ -285,9 +285,9 @@ def updateIPs(ips): ttl = 300 # default Cloudflare TTL print( "⚙️ No config detected for 'ttl' - defaulting to 300 seconds (5 minutes)") - if ttl < 30: + if ttl < 30 or 86400 < ttl: ttl = 1 # - print("⚙️ TTL is too low - defaulting to 1 (auto)") + print("⚙️ TTL must be between 30 (Enterprise) or 60 (standard) and 86400 (1 day) - defaulting to 1 (auto)") if (len(sys.argv) > 1): if (sys.argv[1] == "--repeat"): if ipv4_enabled and ipv6_enabled: