mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user