From e928b915f4dc73ea0ca5fdc314bea2decaf752bf Mon Sep 17 00:00:00 2001 From: KiekerJan Date: Sun, 23 May 2021 21:47:37 +0200 Subject: [PATCH] clean strings before comparing --- management/dns_update.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/management/dns_update.py b/management/dns_update.py index 3429db3f..dfb63298 100755 --- a/management/dns_update.py +++ b/management/dns_update.py @@ -154,7 +154,7 @@ def build_zone(domain, all_domains, additional_records, www_redirect_domains, en if os.path.exists("/etc/usehiddenmasterdns") and len(secondary_ns_list) > 1: with open("/etc/usehiddenmasterdns") as f: for line in f: - if line == domain or line == "usehiddenmasterdns": + if line.strip() == domain or line.strip() == "usehiddenmasterdns": useHiddenMaster = True break @@ -518,7 +518,7 @@ $TTL {defttl} ; default time to live if os.path.exists("/etc/forceshortdnsttl"): with open("/etc/forceshortdnsttl") as f: for line in f: - if line == domain or line == "forceshortdnsttl": + if line.strip() == domain or line.strip() == "forceshortdnsttl": # Override the ttl values p_defttl = "5m" p_refresh = "30m" @@ -537,7 +537,7 @@ $TTL {defttl} ; default time to live if os.path.exists("/etc/usehiddenmasterdns") and len(secondary_ns_list) > 1: with open("/etc/usehiddenmasterdns") as f: for line in f: - if line == domain or line == "usehiddenmasterdns": + if line.strip() == domain or line.strip() == "usehiddenmasterdns": primary_dns = secondary_ns_list[0] break