'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):

    terminal = False
    try:
        terminal = telnetlib.Telnet(host)
    except Exception:
        sickrage.srCore.srLogger.warning((u'Warning:    unable    to    get    a    telnet    session    to    %s' % host))
        return False
    sickrage.srCore.srLogger.debug((u'Connected    to    %s    via    telnet' % host))
    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()
    database = u''
    device = u''
    match = re.search(u'(.+\\.db)\\r\\n?(.+)(?=sh-3.00#    cat    /tmp/netshare)', tnoutput)
    if match:
        database = match.group(1)
        device = match.group(2)
        sickrage.srCore.srLogger.debug((u'Found    NMJ    database    %s    on    device    %s' % (database, device)))
        sickrage.srCore.srConfig.NMJ_DATABASE = database
    else:
        sickrage.srCore.srLogger.warning((u'Could    not    get    current    NMJ    database    on    %s,    NMJ    is    probably    not    running!' % host))
        return False
    if device.startswith(u'NETWORK_SHARE/'):
        match = re.search((u'.*(?=\r\n?%s)' % re.escape(device[14:])), tnoutput)
        if match:
            mount = match.group().replace(u'127.0.0.1', host)
            sickrage.srCore.srLogger.debug((u'Found    mounting    url    on    the    Popcorn    Hour    in    configuration:    %s' % mount))
            sickrage.srCore.srConfig.NMJ_MOUNT = mount
        else:
            sickrage.srCore.srLogger.warning(u'Detected    a    network    share    on    the    Popcorn    Hour,    but    could    not    get    the    mounting    url')
            return False
    return True
