Exemplo n.º 1
0
	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')
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
	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")
Exemplo n.º 5
0
 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")
Exemplo n.º 6
0
	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)