Merge remote branch 'origin/obi/bug_726_interfaces' into acid-burn/networking_changes
[enigma2.git] / lib / python / Plugins / SystemPlugins / WirelessLan / plugin.py
index adf47f0fa286fe3509d18f2a33c3b7e660528e35..efec340a22ee7a70011a699a21eec73d61b0a541 100644 (file)
@@ -454,13 +454,12 @@ def configStrings(iface):
                driver = iNetwork.detectWlanModule(iface)
        else:
                driver = 'dreambox'
-       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 -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'
+       ret = ""
+       if driver == 'madwifi' and config.plugins.wlan.essid.value == "hidden...":
+               ret += "\tpre-up iwconfig " + iface + " essid \"" + config.plugins.wlan.hiddenessid.value + "\" || true\n"
+       ret += "\tpre-up wpa_supplicant -i" + iface + " -c/etc/wpa_supplicant.conf -B -dd -D" + driver + " || true\n"
+       ret += "\tpre-down wpa_cli -i" + iface + " terminate || true\n"
+       return ret
 
 def Plugins(**kwargs):
        return PluginDescriptor(name=_("Wireless LAN"), description=_("Connect to a Wireless Network"), where = PluginDescriptor.WHERE_NETWORKSETUP, needsRestart = False, fnc={"ifaceSupported": callFunction, "configStrings": configStrings, "WlanPluginEntry": lambda x: "Wireless Network Configuartion..."})