diff --git a/server.py b/server.py index e056533..38fca90 100755 --- a/server.py +++ b/server.py @@ -412,23 +412,23 @@ def set_wifi(): os.system('wpa_cli -i wlan0 reconfigure') return index() -def check_internet_connection(host='http://google.com'): +#def check_internet_connection(host='http://google.com'): - try: - urllib.request.urlopen(host) #Python 3.x - return True - except: - return False + #try: + #urllib.request.urlopen(host) #Python 3.x + #return True + #except: + #return False -def check_network_connection(): - ps = subprocess.Popen(['iwconfig'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - try: - output = subprocess.check_output(('grep', 'ESSID'), stdin=ps.stdout) - return True - except subprocess.CalledProcessError: +#def check_network_connection(): + #ps = subprocess.Popen(['iwconfig'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + #try: + #output = subprocess.check_output(('grep', 'ESSID'), stdin=ps.stdout) + #return True + #except subprocess.CalledProcessError: # grep did not match any lines - print("No wireless networks connected") - return False + #print("No wireless networks connected") + #return False def edit_hosts(hostname): current_hosts = open('/etc/hosts')