Revert "Version 2.3.1"

This reverts commit b8002c9f00.
This commit is contained in:
Jeroen Oudshoorn
2023-09-08 20:26:48 +02:00
parent be7f7d0fe1
commit ed36e539ac
8 changed files with 11 additions and 30 deletions

View File

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