From 6d3a6c660827b55cb417e961ba74a86ba4c9bea1 Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 29 Jul 2022 11:13:42 +0100 Subject: [PATCH] Fix error where scriptDir is not defined --- updateCloudflare.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/updateCloudflare.py b/updateCloudflare.py index e7afcca..ff9abe8 100755 --- a/updateCloudflare.py +++ b/updateCloudflare.py @@ -29,7 +29,7 @@ def getZone(email, apiKey, host): print("Could not find a Zone ID for the specified domain.") exit(1) -def storeIP(ip): +def storeIP(ip, scriptDir): # Store the given IP in the lastip file. file = open(scriptDir + 'updateCloudflare.lastip', 'w+') file.write(ip) @@ -134,10 +134,10 @@ def main(): exit(0) else: print("IP has changed since last run... Updating Cloudflare") - storeIP(ip) + storeIP(ip, scriptDir) updateCloudflare(zoneID, authEmail, apiKey, hostToUpdate, ip) else: - storeIP(ip) + storeIP(ip, scriptDir) if ip == cloudflareIP: print("Cloudflare matches our current IP... Exiting") exit(0)