now link dvb-s frontends to dvb-s2 frontends is possible
[enigma2.git] / lib / python / Components / Network.py
index eff51aa08500c7012c98d97ea1a45c3e3e95adb3..d94fa30cd68851e29407e0962c7ebe751c95ecf0 100644 (file)
@@ -269,7 +269,7 @@ class Network:
                        fp.write("iface wlan0 inet dhcp\n")
                if mode == 'wlan-mpci':
                        fp.write("auto ath0\n")
-                       fp.write("iface eth0 inet dhcp\n")
+                       fp.write("iface ath0 inet dhcp\n")
                if mode == 'lan':
                        fp.write("auto eth0\n")
                        fp.write("iface eth0 inet dhcp\n")
@@ -294,20 +294,10 @@ class Network:
                self.getInterfaces()    
 
        def checkNetworkState(self):
-               ok_counter = 0
-               ret1=system("ping -c 1 www.dream-multimedia-tv.de")
-               if ret1 != 0:
-                       ok_counter = ok_counter + 1
-               ret2=system("ping -c 1 www.heise.de")
-               if ret2 != 0:
-                       ok_counter = ok_counter + 1
-               ret3=system("ping -c 1 www.google.de")
-               if ret2 != 0:
-                       ok_counter = ok_counter + 1             
-               if ok_counter <= 2:
-                       return True
-               else:
-                       return False
+                # www.dream-multimedia-tv.de, www.heise.de, www.google.de
+               return system("ping -c 1 82.149.226.170") == 0 or \
+                       system("ping -c 1 193.99.144.85") == 0 or \
+                       system("ping -c 1 209.85.135.103") == 0
 
        def restartNetwork(self):
                iNetwork.deactivateNetworkConfig()
@@ -334,26 +324,15 @@ class Network:
                                return True
                        else:
                                return False
-               
+
        def checkDNSLookup(self):
-               ok_counter = 0
-               ret1=system("nslookup www.dream-multimedia-tv.de")
-               if ret1 != 0:
-                       ok_counter = ok_counter + 1
-               ret2=system("nslookup www.heise.de")
-               if ret2 != 0:
-                       ok_counter = ok_counter + 1
-               ret3=system("nslookup www.google.de")
-               if ret2 != 0:
-                       ok_counter = ok_counter + 1             
-               if ok_counter <= 2:
-                       return True
-               else:
-                       return False
-               
+               return system("nslookup www.dream-multimedia-tv.de") == 0 or \
+                       system("nslookup www.heise.de") == 0 or \
+                       system("nslookup www.google.de")
+
        def deactivateInterface(self,iface):
                system("ifconfig " + iface + " down")
-               
+
        def detectWlanModule(self):
                self.wlanmodule = None
                rt73_dir = "/sys/bus/usb/drivers/rt73/"