'Attempts to solve "Unknown error 132" common with RTL8187 devices.
Puts down interface, unloads/reloads driver module, then puts iface back up.
Returns True if fix was attempted, False otherwise.'

def rtl8187_fix(self, iface):

    proc_airmon = Popen(['airmon-ng'], stdout=PIPE, stderr=DN)
    proc_airmon.wait()
    using_rtl8187 = False
    for line in proc_airmon.communicate()[0].split():
        line = line.upper()
        if ((line.strip() == '') or line.startswith('INTERFACE')):
            continue
        if (line.find(iface.upper()) and (line.find('RTL8187') != (-1))):
            using_rtl8187 = True
    if (not using_rtl8187):
        print ((((R + '    [!]') + O) + '    unable    to    generate    airodump-ng    CSV    file') + W)
        print ((((R + '    [!]') + O) + '    you    may    want    to    disconnect/reconnect    your    wifi    device') + W)
        self.RUN_CONFIG.exit_gracefully(1)
    print (((((((O + '    [!]') + W) + '    attempting    ') + O) + "RTL8187    'Unknown    Error    132'") + W) + '    fix...')
    original_iface = iface
    airmon = Popen(['airmon-ng', 'stop', iface], stdout=PIPE, stderr=DN)
    airmon.wait()
    for line in airmon.communicate()[0].split('\n'):
        if ((line.strip() == '') or line.startswith('Interface') or (line.find('(removed)') != (-1))):
            continue
        original_iface = line.split()[0]
    print_and_exec(['ifconfig', original_iface, 'down'])
    print_and_exec(['rmmod', 'rtl8187'])
    print_and_exec(['rfkill', 'block', 'all'])
    print_and_exec(['rfkill', 'unblock', 'all'])
    print_and_exec(['modprobe', 'rtl8187'])
    print_and_exec(['ifconfig', original_iface, 'up'])
    print_and_exec(['airmon-ng', 'start', original_iface])
    print '\r                                                                                                                                                                                                                                \r',
    print (((O + '    [!]    ') + W) + 'restarting    scan...\n')
    return True
