4
# This program is free software; you can redistribute it and/or
5
# modify it under the terms of the GNU General Public License
6
# as published by the Free Software Foundation; Version 2
16
print "Auto-NDISwrapper 0.1"
18
#Gets the id of all the pci devices
19
outtext = commands.getoutput("lspci -n")
21
#Stores the pci ids in a list
24
#Stores the ids of all the supported cards in a dictionary with the website where the driver is found
25
#Later on we will need something better than this as we will need to assoaciate also the preffered driver
26
D = {'14e4:4324':'http://www.actiontecsupport.com/files/Prism80211b2KXPDrivers.exe','0000:0000':'http://www.yahoo.com/'}
31
#Looks if card is in the list of supported cards
37
card = searchcard(L,D)
39
#This is thanks to mintwifi.py, GPL by the way
41
os.system("lspci | grep \"Network controller\" > /tmp/detected_wireless_devices")
42
devices_file = open("/tmp/detected_wireless_devices")
43
for device_item in devices_file.readlines():
44
deviceArray = device_item.split()
45
device = ' '.join(deviceArray[3:])
46
pci_id_line = commands.getoutput("lspci -n | grep " + deviceArray[0])
47
pci_id_array = pci_id_line.split()
48
pci_id = ' '.join(pci_id_array[2:])
49
print "Sorry, card not yet supported by Auto-NDISwrapper but most likely there are other solutions"
50
print "Save this output as it will help other people give you support"
52
print " ==> PCI ID = " + pci_id
55
print "Card Supported"
56
print "Fetching driver for card with pci id", card
58
os.system(string.join(("wget ",URL)))
59
Files = URL.split("/")
60
#Will we need a elif for every compression format?
62
os.system(string.join(("unzip",Files[-1])))
63
Inf = os.system("ls -t")
64
#This is a really ugly solution does anyone know of anything better
68
os.system(string.join(("sudo ndiswrapper -i ",item)))
69
os.system("ndiswrapper -l")
70
os.system("sudo modeprobe ndiswrapper")
71
os.system("sudo ndiswrapper -m")