def handle_setup(environ, start_response): for i in range(10): iface = get_working_hotspot_iface() if not iface: gevent.sleep(2) continue ip, _ = get_ip_and_mac(iface) if '10.24.1.1' != ip: setup_networking(iface) start_response(httplib.OK, [('Content-Type', 'text/plain')]) return []
def handle_is_started(environ, start_response): start_response(httplib.OK, [('Content-Type', 'text/plain')]) yield 'TRUE' if get_working_hotspot_iface() else 'FALSE'
def is_alive(): return get_working_hotspot_iface()
def is_wifi_repeater_started(): if wifi.has_started_before: return wifi.get_working_hotspot_iface() return False
def handle_started(environ, start_response): start_response(httplib.OK, [('Content-Type', 'text/plain')]) yield 'TRUE' if get_working_hotspot_iface() else 'FALSE'