gwinfo: Delete IP addresses for old netif entries
This ensures that only the latest addresses are shown on the gateway overview page. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
b0165a4c9c
commit
7e34a20451
|
@ -26,6 +26,11 @@ def import_gw_data(mysql, gw_data):
|
|||
SET stats_page = %s, last_contact = %s
|
||||
WHERE id = %s
|
||||
""",(gw_data["stats_page"],time,newid,))
|
||||
mysql.execute("""
|
||||
UPDATE gw_netif
|
||||
SET ipv4 = NULL, ipv6 = NULL, dhcpstart = NULL, dhcpend = NULL
|
||||
WHERE gw = %s
|
||||
""",(newid,))
|
||||
else:
|
||||
mysql.execute("""
|
||||
INSERT INTO gw (name, stats_page, last_contact)
|
||||
|
|
Loading…
Reference in New Issue