Merge branch 'bug_236_recordpath'
[enigma2.git] / lib / python / Plugins / SystemPlugins / WirelessLan / plugin.py
index 74520dcc19c37e2bfd1faf8b864f0c8bda4dcf09..b7a64b9a44400f5b2e7311a75925d939b63d503b 100755 (executable)
@@ -271,15 +271,14 @@ def callFunction(iface):
 
 def configStrings(iface):
        driver = iNetwork.detectWlanModule()
-       print "WLAN-MODULE",driver
-       if driver == 'ralink':
-               return "        pre-up /usr/sbin/wpa_supplicant -i"+iface+" -c/etc/wpa_supplicant.conf -B -Dralink\n    post-down wpa_cli terminate"
-       if driver == 'madwifi':
+       print "Found WLAN-Driver:",driver
+       if driver  in ('ralink', 'zydas'):
+               return "        pre-up /usr/sbin/wpa_supplicant -i"+iface+" -c/etc/wpa_supplicant.conf -B -D"+driver+"\n        post-down wpa_cli terminate"
+       else:
                if config.plugins.wlan.essid.value == "hidden...":
-                       return "        pre-up iwconfig "+iface+" essid "+config.plugins.wlan.hiddenessid.value+"\n     pre-up /usr/sbin/wpa_supplicant -i"+iface+" -c/etc/wpa_supplicant.conf -B -dd -Dmadwifi\n       post-down wpa_cli terminate"
-               return "        pre-up iwconfig "+iface+" essid "+config.plugins.wlan.essid.value+"\n   pre-up /usr/sbin/wpa_supplicant -i"+iface+" -c/etc/wpa_supplicant.conf -B -dd -Dmadwifi\n       post-down wpa_cli terminate"
-       if driver == 'zydas':
-               return "        pre-up /usr/sbin/wpa_supplicant -i"+iface+" -c/etc/wpa_supplicant.conf -B -dd -Dzydas\n post-down wpa_cli terminate"
+                       return '        pre-up iwconfig '+iface+' essid "'+config.plugins.wlan.hiddenessid.value+'"\n   pre-up /usr/sbin/wpa_supplicant -i'+iface+' -c/etc/wpa_supplicant.conf -B -dd -D'+driver+'\n    post-down wpa_cli terminate'
+               else:
+                       return '        pre-up iwconfig '+iface+' essid "'+config.plugins.wlan.essid.value+'"\n pre-up /usr/sbin/wpa_supplicant -i'+iface+' -c/etc/wpa_supplicant.conf -B -dd -D'+driver+'\n    post-down wpa_cli terminate'
 
 def Plugins(**kwargs):
        return PluginDescriptor(name=_("Wireless LAN"), description=_("Connect to a Wireless Network"), where = PluginDescriptor.WHERE_NETWORKSETUP, fnc={"ifaceSupported": callFunction, "configStrings": configStrings, "WlanPluginEntry": lambda x: "Wireless Network Configuartion..."})