def run(): iptables.init_fq_chains() shutdown_hook.add(iptables.flush_fq_chain) if config.read().get('comp_wifi_enabled', True): start_components(comp_wifi, comp_lan) else: LOGGER.info('wifi component disabled by config') comp_wifi.setup_lo_alias() start_components(comp_lan) httpd.HANDLERS[('GET', 'ping')] = handle_ping httpd.HANDLERS[('POST', 'free-internet/connect')] = handle_free_internet_connect httpd.HANDLERS[('POST', 'free-internet/disconnect')] = handle_free_internet_disconnect httpd.HANDLERS[('GET', 'free-internet/is-connected')] = handle_free_internet_is_connected httpd.serve_forever()
def run(): iptables.init_fq_chains() shutdown_hook.add(iptables.flush_fq_chain) if config.read().get('comp_wifi_enabled', True): start_components(comp_wifi, comp_lan) else: LOGGER.info('wifi component disabled by config') comp_wifi.setup_lo_alias() start_components(comp_lan) httpd.HANDLERS[('GET', 'ping')] = handle_ping httpd.HANDLERS[('POST', 'free-internet/connect')] = handle_free_internet_connect httpd.HANDLERS[('POST', 'free-internet/disconnect')] = handle_free_internet_disconnect httpd.HANDLERS[('GET', 'free-internet/is-connected')] = handle_free_internet_is_connected gevent.spawn(check_ping) httpd.serve_forever()