From d3fe3940f9438e1e66e583b2a62c368d414276dd Mon Sep 17 00:00:00 2001 From: Arul Date: Tue, 21 Feb 2023 06:53:01 +0530 Subject: [PATCH] addressing review comments --- cloudflare-ddns.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cloudflare-ddns.py b/cloudflare-ddns.py index ca169c1..d13b4c3 100755 --- a/cloudflare-ddns.py +++ b/cloudflare-ddns.py @@ -263,7 +263,10 @@ if __name__ == '__main__': config = None try: with open(os.path.join(CONFIG_PATH, "config.json")) as config_file: - config = json.loads(Template(config_file.read()).safe_substitute(ENV_VARS)) + if len(ENV_VARS) != 0: + config = json.loads(Template(config_file.read()).safe_substitute(ENV_VARS)) + else: + config = json.loads(config_file.read()) except: print("😡 Error reading config.json") # wait 10 seconds to prevent excessive logging on docker auto restart @@ -313,4 +316,4 @@ if __name__ == '__main__': print("❓ Unrecognized parameter '" + sys.argv[1] + "'. Stopping now.") else: - updateIPs(getIPs()) \ No newline at end of file + updateIPs(getIPs())