X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/afaf135fada044aab3bf21e02bcc7ffe138106b4..a34ef895210161a8820e96829ac87806566e7858:/lib/python/Components/Network.py diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 7cc61d84..64b3aa6c 100755 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -63,6 +63,8 @@ class Network: def getDataForInterface(self, iface,callback): #get ip out of ip addr, as avahi sometimes overrides it in ifconfig. + if not self.Console: + self.Console = Console() cmd = "ip -o addr" self.Console.ePopen(cmd, self.IPaddrFinished, [iface,callback]) @@ -201,7 +203,7 @@ class Network: ifaces[currif]["gateway"] = map(int, split[1].split('.')) if self.ifaces[currif].has_key("gateway"): if self.ifaces[currif]["gateway"] != ifaces[currif]["gateway"] and ifaces[currif]["dhcp"] == False: - self.ifaces[currif]["gateway"] = map(int, split[1].split('.')) + self.ifaces[currif]["gateway"] = map(int, split[1].split('.')) if (split[0] == "pre-up"): if self.ifaces[currif].has_key("preup"): self.ifaces[currif]["preup"] = i @@ -212,15 +214,16 @@ class Network: for ifacename, iface in ifaces.items(): if self.ifaces.has_key(ifacename): self.ifaces[ifacename]["dhcp"] = iface["dhcp"] - if len(self.Console.appContainers) == 0: - # save configured interfacelist - self.configuredNetworkAdapters = self.configuredInterfaces - # load ns only once - self.loadNameserverConfig() - print "read configured interfac:", ifaces - print "self.ifaces after loading:", self.ifaces - if callback is not None: - callback(True) + if self.Console: + if len(self.Console.appContainers) == 0: + # save configured interfacelist + self.configuredNetworkAdapters = self.configuredInterfaces + # load ns only once + self.loadNameserverConfig() + print "read configured interfac:", ifaces + print "self.ifaces after loading:", self.ifaces + if callback is not None: + callback(True) def loadNameserverConfig(self): ipRegexp = "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"