mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
Update pialert.py
This commit is contained in:
@@ -126,23 +126,26 @@ def check_internet_IP ():
|
|||||||
closeDB()
|
closeDB()
|
||||||
|
|
||||||
# Get Dynamic DNS IP
|
# Get Dynamic DNS IP
|
||||||
print ('\nRetrieving Dynamic DNS IP...')
|
if DDNS_ACTIVE :
|
||||||
dns_IP = get_dynamic_DNS_IP()
|
print ('\nRetrieving Dynamic DNS IP...')
|
||||||
|
dns_IP = get_dynamic_DNS_IP()
|
||||||
|
|
||||||
# Check Dynamic DNS IP
|
# Check Dynamic DNS IP
|
||||||
if dns_IP == "" :
|
if dns_IP == "" :
|
||||||
print (' Error retrieving Dynamic DNS IP')
|
print (' Error retrieving Dynamic DNS IP')
|
||||||
print (' Exiting...\n')
|
print (' Exiting...\n')
|
||||||
return 1
|
return 1
|
||||||
print (' ', dns_IP)
|
print (' ', dns_IP)
|
||||||
|
|
||||||
# Check DNS Change
|
# Check DNS Change
|
||||||
if dns_IP != internet_IP :
|
if dns_IP != internet_IP :
|
||||||
print (' Updating Dynamic DNS IP...')
|
print (' Updating Dynamic DNS IP...')
|
||||||
message = set_dynamic_DNS_IP ()
|
message = set_dynamic_DNS_IP ()
|
||||||
print (' ', message)
|
print (' ', message)
|
||||||
|
else :
|
||||||
|
print (' No changes to perform')
|
||||||
else :
|
else :
|
||||||
print (' No changes to perform')
|
print ('\nSkipping Dynamic DNS update...')
|
||||||
|
|
||||||
# OK
|
# OK
|
||||||
return 0
|
return 0
|
||||||
@@ -468,6 +471,8 @@ def copy_pihole_network ():
|
|||||||
FROM PH.network
|
FROM PH.network
|
||||||
WHERE hwaddr NOT LIKE 'ip-%'
|
WHERE hwaddr NOT LIKE 'ip-%'
|
||||||
AND hwaddr <> '00:00:00:00:00:00' """)
|
AND hwaddr <> '00:00:00:00:00:00' """)
|
||||||
|
sql.execute ("""UPDATE PiHole_Network SET PH_Name = '(unknown)'
|
||||||
|
WHERE PH_Name IS NULL OR PH_Name = '' """)
|
||||||
# DEBUG
|
# DEBUG
|
||||||
# print (sql.rowcount)
|
# print (sql.rowcount)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user