Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arulrajnet committed Feb 21, 2023
1 parent fa79547 commit d3fe394
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cloudflare-ddns.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ def updateIPs(ips):
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
Expand Down Expand Up @@ -313,4 +316,4 @@ def updateIPs(ips):
print("❓ Unrecognized parameter '" +
sys.argv[1] + "'. Stopping now.")
else:
updateIPs(getIPs())
updateIPs(getIPs())

0 comments on commit d3fe394

Please sign in to comment.