Use if __name_ == "__main__"

This commit is contained in:
2022-07-20 21:49:04 +01:00
parent 236f8fcfe6
commit d7ff9743f8
+4
View File
@@ -68,6 +68,7 @@ def updateCloudflare(zone, email, apiKey, host, ip):
else:
print("Updating failed, errors were: " + str(result["errors"]))
def main():
print(
'''
------------------------------
@@ -143,3 +144,6 @@ else:
else:
print("Cloudflare IP does not match our current IP... Updating Cloudflare.")
updateCloudflare(zoneID, authEmail, apiKey, hostToUpdate, ip)
if __name__ == "__main__":
main()