def internet_connected():
"""
This fucntion detects if the internet is available
Returns a Boolean value
"""
if STARTUP:
print(OR + '[X] STARTUP: ' + W + 'Checking Internet..............' + W, end='')
else:
print(Y + '[+] INFO: ' + W + 'Checking Internet.................' + W, end='')
try:
socket.create_connection(('172.217.3.3', 443), 5) # Test connection by connecting to google
socket.create_connection(('192.30.253.113', 443), 5)
print(G + 'OK!' + W)
return True
except socket.error:
print(R + 'NO INTERNET!' + W)
return False
评论列表
文章目录