From 0e0e9f998993ee7a71fc1ba18d7ba93547e49299 Mon Sep 17 00:00:00 2001 From: Timothy Miller <46549361+timothymiller@users.noreply.github.com> Date: Sat, 30 Jul 2022 20:09:38 -0400 Subject: [PATCH] Fixed bug that caused the root domain to not update --- cloudflare-ddns.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cloudflare-ddns.py b/cloudflare-ddns.py index e516739..dc24ddd 100755 --- a/cloudflare-ddns.py +++ b/cloudflare-ddns.py @@ -106,9 +106,12 @@ def commitRecord(ip): ttl = 300 # default Cloudflare TTL for subdomain in subdomains: subdomain = subdomain.lower().strip() + fqdn = base_domain_name + if subdomain != '': + fqdn = subdomain + "." + base_domain_name record = { "type": ip["type"], - "name": subdomain, + "name": fqdn, "content": ip["ip"], "proxied": option["proxied"], "ttl": ttl @@ -117,9 +120,6 @@ def commitRecord(ip): "zones/" + option['zone_id'] + "/dns_records?per_page=100&type=" + ip["type"], "GET", option) - fqdn = base_domain_name - if subdomain: - fqdn = subdomain + "." + base_domain_name identifier = None modified = False duplicate_ids = []