mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Version 2.3.6
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():
|
def is_connected():
|
||||||
try:
|
try:
|
||||||
# check DNS
|
# check DNS
|
||||||
host = socket.gethostbyname('api.pwnagotchi.ai')
|
host = 'https://api.opwngrid.xyz/api/v1/uptime'
|
||||||
if host:
|
r = requests.get(host, headers=None, timeout=(30.0, 60.0))
|
||||||
# check connectivity itself
|
if r.json().get('isUp'):
|
||||||
socket.create_connection((host, 443), timeout=30)
|
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user