zone update fixes
This commit is contained in:
parent
ff4302cf0a
commit
b1a296f05a
29
dyndomain
29
dyndomain
@ -288,7 +288,7 @@ def livebox_add_port_nat(port, addr):
|
||||
'origin': 'webui',
|
||||
'sourceInterface': 'data',
|
||||
'destinationIPAddress': addr,
|
||||
'protocol': '6',
|
||||
'protocol': '6,17',
|
||||
'internalPort': port,
|
||||
'enable': True,
|
||||
}
|
||||
@ -303,7 +303,8 @@ def livebox_add_pinhole(port, addr):
|
||||
'sourceInterface': 'data',
|
||||
'destinationPort': port,
|
||||
'destinationIPAddress': addr,
|
||||
'protocol': '6',
|
||||
'protocol': '6,17',
|
||||
'ipversion': '6',
|
||||
'enable': True,
|
||||
}
|
||||
r = sysbus.requete('Firewall:setPinhole', a)
|
||||
@ -341,20 +342,21 @@ def send_update_mail(mail_to, mail_from, zone_domain, update, mail_ignore_list,
|
||||
msg['To' ] = mail_to
|
||||
|
||||
txt = "Livebox update\n\n"
|
||||
txt = txt + "WAN IPv4 : %s\n" % wan['ipv4']
|
||||
txt = txt + "WAN IPv6 : %s\n" % wan['ipv6']
|
||||
|
||||
txt = txt + "\nZone %s has been updated:\n" % zone_domain
|
||||
|
||||
for prot,name,addr in update['add']:
|
||||
txt = txt + " %-20s %-4s %s\n" % (name,prot,addr)
|
||||
if updated['add']:
|
||||
txt = txt + "\nUpdated entries:\n"
|
||||
for prot,name,addr in update['add']:
|
||||
txt = txt + " %-20s %-4s %s\n" % (name,prot,addr)
|
||||
|
||||
txt = txt + "\nRemoved entries:\n"
|
||||
|
||||
for prot,name,addr in update['delete']:
|
||||
txt = txt + " %-20s %-4s %s\n" % (name,prot,addr)
|
||||
if update['delete']:
|
||||
txt = txt + "\nRemoved entries:\n"
|
||||
for prot,name,addr in update['delete']:
|
||||
txt = txt + " %-20s %-4s %s\n" % (name,prot,addr)
|
||||
|
||||
txt = txt + '\n'
|
||||
txt = txt + "WAN IPv4 : %s\n" % wan['ipv4']
|
||||
txt = txt + "WAN IPv6 : %s\n" % wan['ipv6']
|
||||
|
||||
msg.set_content(txt)
|
||||
|
||||
@ -392,6 +394,9 @@ if update:
|
||||
success = ovh_update_zone(zone_domain, zone, update, sync_zone)
|
||||
livebox_update_fw(zone, update, sync_zone)
|
||||
if success:
|
||||
send_update_mail(mail_to, mail_from, zone_domain, update, mail_ignore_list, wan)
|
||||
try:
|
||||
send_update_mail(mail_to, mail_from, zone_domain, update, mail_ignore_list, wan)
|
||||
except:
|
||||
pass
|
||||
|
||||
write_zone_list(zone_filename, zone, update)
|
||||
|
Loading…
Reference in New Issue
Block a user