def checkOldInterfaceState(self): # disable up interface if it was originally down and config is unchanged. if self.originalAth0State is False and self.originalInterfaceStateChanged is False: if iNetwork.checkforInterface('ath0') is True: iNetwork.deactivateInterface('ath0') if self.originalEth0State is False and self.originalInterfaceStateChanged is False: if iNetwork.checkforInterface('eth0') is True: iNetwork.deactivateInterface('eth0') if self.originalWlan0State is False and self.originalInterfaceStateChanged is False: if iNetwork.checkforInterface('wlan0') is True: iNetwork.deactivateInterface('wlan0')
def checkInterface(self, iface): self.stopScan() if self.Adapterlist is None: self.Adapterlist = iNetwork.getAdapterList() if self.NextStep is not 'end': if len(self.Adapterlist) == 0: #Reset Network to defaults if network broken iNetwork.resetNetworkConfig('lan', self.resetNetworkConfigCB) self.resetRef = self.session.openWithCallback( self.resetNetworkConfigFinished, MessageBox, _("Please wait while we prepare your network interfaces..." ), type=MessageBox.TYPE_INFO, enable_input=False) if iface in iNetwork.getInstalledAdapters(): if iface in iNetwork.configuredNetworkAdapters and len( iNetwork.configuredNetworkAdapters) == 1: if iNetwork.getAdapterAttribute(iface, 'up') is True: self.isInterfaceUp = True else: self.isInterfaceUp = False self.currStep = self.getStepWithID(self.NextStep) self.afterAsyncCode() else: self.isInterfaceUp = iNetwork.checkforInterface(iface) self.currStep = self.getStepWithID(self.NextStep) self.afterAsyncCode() else: self.resetNetworkConfigFinished(False)
def checkInterface(self, iface): self.stopScan() if self.Adapterlist is None: self.Adapterlist = iNetwork.getAdapterList() if self.NextStep is not "end": if len(self.Adapterlist) == 0: # Reset Network to defaults if network broken iNetwork.resetNetworkConfig("lan", self.resetNetworkConfigCB) self.resetRef = self.session.openWithCallback( self.resetNetworkConfigFinished, MessageBox, _("Please wait while we prepare your network interfaces..."), type=MessageBox.TYPE_INFO, enable_input=False, ) if iface in iNetwork.getInstalledAdapters(): if iface in iNetwork.configuredNetworkAdapters and len(iNetwork.configuredNetworkAdapters) == 1: if iNetwork.getAdapterAttribute(iface, "up") is True: self.isInterfaceUp = True else: self.isInterfaceUp = False self.currStep = self.getStepWithID(self.NextStep) self.afterAsyncCode() else: self.isInterfaceUp = iNetwork.checkforInterface(iface) self.currStep = self.getStepWithID(self.NextStep) self.afterAsyncCode() else: self.resetNetworkConfigFinished(False)
def checkOldInterfaceState(self): # disable up interface if it was originally down and config is unchanged. if self.originalInterfaceStateChanged is False: for interface in self.originalInterfaceState.keys(): if self.originalInterfaceState[interface]["up"] is False: if iNetwork.checkforInterface(interface) is True: system("ifconfig " + interface + " down")
def checkOldInterfaceState(self): # disable up interface if it was originally down and config is unchanged. if self.originalInterfaceStateChanged is False: for interface in self.originalInterfaceState.keys(): if interface == self.selectedInterface: if self.originalInterfaceState[interface]["up"] is False: if iNetwork.checkforInterface(interface) is True: enigma.eConsoleAppContainer().execute("ifconfig %s down" % interface)