# Path: lib/settings.py
# def get_top_domains(dbname):


from configparser import SafeConfigParser
from lib.logger import *
from lib.settings import homenet, lock
import threading
import os
import time
import lib.utils as utils
import netifaces
                homenet.mailer_address = user_config.get('main', 'mailer_address').strip('"')
                homenet.mailer_pwd = user_config.get('main', 'mailer_pwd').strip('"')
                homenet.allow_tor = user_config.get('main', 'allow_tor').strip('"')

            if flag:
                counter += 1

            if counter > 1:
                utils.restart_falcongate_service()

            time.sleep(5)


class CheckNetworkModifications(threading.Thread):
    def __init__(self, threadID):
        threading.Thread.__init__(self)
        self.threadID = threadID

    def run(self):

        while 1:
            gws = netifaces.gateways()
            cgw = gws['default'][netifaces.AF_INET][0]
            if not homenet.gateway:
                homenet.gateway = cgw
            else:
                if homenet.gateway != cgw:
                    utils.reconfigure_network(homenet.gateway, cgw)
                    homenet.gateway = cgw
                    try:

# Path: lib/settings.py
# def get_top_domains(dbname):


# Path: lib/config.py
from configparser import SafeConfigParser
from lib.logger import *
from lib.settings import homenet, lock
import threading
import os
import time
import lib.utils as utils
import netifaces

                homenet.mailer_address = user_config.get('main', 'mailer_address').strip('"')
                homenet.mailer_pwd = user_config.get('main', 'mailer_pwd').strip('"')
                homenet.allow_tor = user_config.get('main', 'allow_tor').strip('"')

            if flag:
                counter += 1

            if counter > 1:
                utils.restart_falcongate_service()

            time.sleep(5)


class CheckNetworkModifications(threading.Thread):
    def __init__(self, threadID):
        threading.Thread.__init__(self)
        self.threadID = threadID

    def run(self):

        while 1:
            gws = netifaces.gateways()
            cgw = gws['default'][netifaces.AF_INET][0]
            if not homenet.gateway:
                homenet.gateway = cgw
            else:
                if homenet.gateway != cgw:
                    utils.reconfigure_network(homenet.gateway, cgw)
                    homenet.gateway = cgw
                    try:

                        with lock: