Use if __name_ == "__main__"

This commit is contained in:
2022-07-20 21:48:41 +01:00
parent 236f8fcfe6
commit d7ff9743f8

View File

@@ -68,6 +68,7 @@ def updateCloudflare(zone, email, apiKey, host, ip):
else: else:
print("Updating failed, errors were: " + str(result["errors"])) print("Updating failed, errors were: " + str(result["errors"]))
def main():
print( print(
''' '''
------------------------------ ------------------------------
@@ -143,3 +144,6 @@ else:
else: else:
print("Cloudflare IP does not match our current IP... Updating Cloudflare.") print("Cloudflare IP does not match our current IP... Updating Cloudflare.")
updateCloudflare(zoneID, authEmail, apiKey, hostToUpdate, ip) updateCloudflare(zoneID, authEmail, apiKey, hostToUpdate, ip)
if __name__ == "__main__":
main()