diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2008-06-03 23:11:53 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2008-06-03 23:11:53 +0000 |
| commit | 90916ed5481cd1d0a68985033043005143c42c60 (patch) | |
| tree | fd591612a6b513ec50426d25b8d7ac1cbb433bb2 /lib/python/Components | |
| parent | b5513ae969d3d8e5a0870d21cf6c8499987b1135 (diff) | |
| download | enigma2-90916ed5481cd1d0a68985033043005143c42c60.tar.gz enigma2-90916ed5481cd1d0a68985033043005143c42c60.zip | |
extend ping test, fix configuredInterface list
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Network.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 3d114c1c..1c2b54e8 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -6,6 +6,7 @@ from enigma import eTimer, eConsoleAppContainer class Network: def __init__(self): self.ifaces = {} + self.configuredInterfaces = {} self.nameservers = [] self.getInterfaces() self.ethtool_bin = "/usr/sbin/ethtool" @@ -159,7 +160,8 @@ class Network: ifaces[currif]["netmask"] = map(int, split[1].split('.')) if (split[0] == "gateway"): ifaces[currif]["gateway"] = map(int, split[1].split('.')) - + + self.configuredInterfaces = ifaces print "read interfaces:", ifaces for ifacename, iface in ifaces.items(): if self.ifaces.has_key(ifacename): @@ -281,8 +283,17 @@ class Network: os.system("ifconfig wlan0 down") def checkNetworkState(self): - ret=os.system("ping -c 1 www.dream-multimedia-tv.de") - if ret == 0: + ok_counter = 0 + ret1=os.system("ping -c 1 www.dream-multimedia-tv.de") + if ret1 != 0: + ok_counter = ok_counter + 1 + ret2=os.system("ping -c 1 www.heise.de") + if ret2 != 0: + ok_counter = ok_counter + 1 + ret3=os.system("ping -c 1 www.google.de") + if ret2 != 0: + ok_counter = ok_counter + 1 + if ok_counter == 0: return True else: return False |
