fix & cleanup
This commit is contained in:
parent
f381cc46d8
commit
b012a6b7dd
1 changed files with 19 additions and 19 deletions
|
@ -50,7 +50,7 @@ checkDNS_interval_hrs = 12.1 # when the saved IP addresses are old, check the DN
|
|||
current_ip_file = "/tmp/current_ip.json"
|
||||
|
||||
|
||||
def send_email(msg, sender = 'no_reply@mydomain.com', receiver = 'admin@mydomain.com')
|
||||
def send_email(msg, sender = 'no_reply@mydomain.com', receiver = 'admin@mydomain.com') :
|
||||
import smtplib
|
||||
|
||||
try :
|
||||
|
@ -186,7 +186,7 @@ if current_ipv4 or current_ipv6 : #we could get at least one address
|
|||
#print("Not touching AAAA record for {}.{}, as instructed".format(subdomain, domain))
|
||||
pass
|
||||
#all hosts records have been updated without errors, log change and save current addresses
|
||||
print("{} : new addresses {} ; {} -- {} records updates".format(timestamp(), current_ipv4, current_ipv6, records_changed)
|
||||
print("{} : new addresses {} ; {} -- {} records updates".format(timestamp(), current_ipv4, current_ipv6, records_changed))
|
||||
with open(current_ip_file, 'w') as f:
|
||||
json.dump([time.time(), current_ipv4, current_ipv6],f)
|
||||
except Exception as e: #some error occured (API down, keys expired...?),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue