fix previous_IP

This commit is contained in:
Jokob-sk
2023-01-01 10:15:29 +11:00
parent 2ab0807b05
commit f0290da391
2 changed files with 12 additions and 3 deletions

View File

@@ -816,10 +816,18 @@ def set_dynamic_DNS_IP ():
#-------------------------------------------------------------------------------
def get_previous_internet_IP ():
# get previos internet IP stored in DB
previous_IP = '0.0.0.0'
# get previous internet IP stored in DB
openDB()
sql.execute ("SELECT dev_LastIP FROM Devices WHERE dev_MAC = 'Internet' ")
previous_IP = sql.fetchone()[0]
result = sql.fetchone()
if len(result) > 0:
previous_IP = sql.fetchone()[0]
closeDB()
# return previous IP

View File

@@ -13,7 +13,7 @@ services:
- ${APP_DATA_LOCATION}/pialert/db/setting_darkmode:/home/pi/pialert/db/setting_darkmode
# (optional) useful for debugging if you have issues setting up the container
- ${LOGS_LOCATION}:/home/pi/pialert/front/log
# comment out / delete below lines, they are only for development purposes
# DELETE START anyone trying to use this file: comment out / delete BELOW lines, they are only for development purposes
- ${DEV_LOCATION}/back/pialert.py:/home/pi/pialert/back/pialert.py
- ${DEV_LOCATION}/back/update_vendors.sh:/home/pi/pialert/back/update_vendors.sh
- ${DEV_LOCATION}/pholus:/home/pi/pialert/pholus
@@ -31,6 +31,7 @@ services:
- ${DEV_LOCATION}/front/network.php:/home/pi/pialert/front/network.php
- ${DEV_LOCATION}/front/presence.php:/home/pi/pialert/front/presence.php
- ${DEV_LOCATION}/front/settings.php:/home/pi/pialert/front/settings.php
# DELETE END anyone trying to use this file: comment out / delete ABOVE lines, they are only for development purposes
environment:
- TZ=${TZ}
- PORT=${PORT}