Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions cloudflare-lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ def healthcheck(host):

def get_rec_id(name, host):
for y in RECS:
if y['display_name'] == name and y['content'] == host and (y['type'] == "A" or y['type'] == "AAAA"):
r = name
if name == '@':
r = DOMAIN

if y['display_name'] == r and y['content'] == host and (y['type'] == "A" or y['type'] == "AAAA"):
return y['rec_id']
return False

Expand All @@ -87,7 +91,7 @@ def get_rec_id(name, host):

if INTERVAL >= 0:
lapse = int(time.time() - start_time)
print "DONE: sleeping for {0} seconds".format(str(INTERVAL-lapse))
time.sleep(INTERVAL-lapse) #sleep for some set time seconds
print "DONE: sleeping for {0} seconds".format(str(abs(INTERVAL-lapse)))
time.sleep(abs(INTERVAL-lapse)) #sleep for some set time seconds
else:
exit()