'Retrieves the settings from a NMJ/Popcorn hour
host: The hostname/IP of the Popcorn Hour server
Returns: True if the settings were retrieved successfully, False otherwise'

def notify_settings(self, host):

    try:
        terminal = telnetlib.Telnet(host)
    except Exception:
        logger.log(u'Warning:    unable    to    get    a    telnet    session    to    {0}'.format(host), logger.WARNING)
        return False
    logger.log(u'Connected    to    {0}    via    telnet'.format(host), logger.DEBUG)
    terminal.read_until(u'sh-3.00#    ')
    terminal.write(u'cat    /tmp/source\n')
    terminal.write(u'cat    /tmp/netshare\n')
    terminal.write(u'exit\n')
    tnoutput = terminal.read_all()
    match = re.search(u'(.+\\.db)\\r\\n?(.+)(?=sh-3.00#    cat    /tmp/netshare)', tnoutput)
    if match:
        database = match.group(1)
        device = match.group(2)
        logger.log(u'Found    NMJ    database    {0}    on    device    {1}'.format(database, device), logger.DEBUG)
        sickbeard.NMJ_DATABASE = database
    else:
        logger.log(u'Could    not    get    current    NMJ    database    on    {0},    NMJ    is    probably    not    running!'.format(host), logger.WARNING)
        return False
    if device.startswith(u'NETWORK_SHARE/'):
        match = re.search(u'.*(?=\r\n?{0})'.format(re.escape(device[14:])), tnoutput)
        if match:
            mount = match.group().replace(u'127.0.0.1', host)
            logger.log(u'Found    mounting    url    on    the    Popcorn    Hour    in    configuration:    {0}'.format(mount), logger.DEBUG)
            sickbeard.NMJ_MOUNT = mount
        else:
            logger.log(u'Detected    a    network    share    on    the    Popcorn    Hour,    but    could    not    get    the    mounting    url', logger.WARNING)
            return False
    return True
