Version 2.3.1

Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>

Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-09-06 17:01:26 +02:00
parent d8f726745f
commit 6213e9803f
8 changed files with 30 additions and 11 deletions

View File

@ -13,10 +13,9 @@ API_ADDRESS = "http://127.0.0.1:8666/api/v1"
def is_connected():
try:
# check DNS
host = socket.gethostbyname('api.pwnagotchi.ai')
if host:
# check connectivity itself
socket.create_connection((host, 443), timeout=30)
host = 'https://api.opwngrid.xyz/api/v1/uptime'
r = requests.get(host, headers=None, timeout=(30.0, 60.0))
if r.json().get('isUp'):
return True
except:
pass