mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-15 22:51:37 -07:00
fix previous_IP
This commit is contained in:
+10
-2
@@ -816,10 +816,18 @@ def set_dynamic_DNS_IP ():
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
def get_previous_internet_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()
|
openDB()
|
||||||
|
|
||||||
sql.execute ("SELECT dev_LastIP FROM Devices WHERE dev_MAC = 'Internet' ")
|
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()
|
closeDB()
|
||||||
|
|
||||||
# return previous IP
|
# return previous IP
|
||||||
|
|||||||
+2
-1
@@ -13,7 +13,7 @@ services:
|
|||||||
- ${APP_DATA_LOCATION}/pialert/db/setting_darkmode:/home/pi/pialert/db/setting_darkmode
|
- ${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
|
# (optional) useful for debugging if you have issues setting up the container
|
||||||
- ${LOGS_LOCATION}:/home/pi/pialert/front/log
|
- ${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/pialert.py:/home/pi/pialert/back/pialert.py
|
||||||
- ${DEV_LOCATION}/back/update_vendors.sh:/home/pi/pialert/back/update_vendors.sh
|
- ${DEV_LOCATION}/back/update_vendors.sh:/home/pi/pialert/back/update_vendors.sh
|
||||||
- ${DEV_LOCATION}/pholus:/home/pi/pialert/pholus
|
- ${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/network.php:/home/pi/pialert/front/network.php
|
||||||
- ${DEV_LOCATION}/front/presence.php:/home/pi/pialert/front/presence.php
|
- ${DEV_LOCATION}/front/presence.php:/home/pi/pialert/front/presence.php
|
||||||
- ${DEV_LOCATION}/front/settings.php:/home/pi/pialert/front/settings.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:
|
environment:
|
||||||
- TZ=${TZ}
|
- TZ=${TZ}
|
||||||
- PORT=${PORT}
|
- PORT=${PORT}
|
||||||
|
|||||||
Reference in New Issue
Block a user