From 8e2a64124412426c6c1ef47d4b54a5ddc610a83e Mon Sep 17 00:00:00 2001 From: Jeroen Oudshoorn Date: Sat, 9 Sep 2023 11:12:27 +0200 Subject: [PATCH] Version 2.3.6 Signed-off-by: Jeroen Oudshoorn Signed-off-by: Jeroen Oudshoorn --- pwnagotchi/grid.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pwnagotchi/grid.py b/pwnagotchi/grid.py index a76c269d..b4abe77a 100644 --- a/pwnagotchi/grid.py +++ b/pwnagotchi/grid.py @@ -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