Hello guys ?!!
I'm working on some plugin to change ip ...
Just I want to change this def to work on dreamos oe2.5/2.6 images ..
This my def for oe2.0 and not compatible with OE2.5/2.6 ..
Please any advices ?!
the def just for restart Network after change ip ..
Code
def restartNetwork(self,callback = None):
self.config_ready = False
self.msgPlugins()
self.commands = []
self.commands.append("/etc/init.d/avahi-daemon stop")
for iface in self.ifaces.keys():
if iface != 'eth0' or not self.onRemoteRootFS():
self.commands.append(("/sbin/ifdown", "/sbin/ifdown", iface))
self.commands.append("/sbin/ip addr flush dev " + iface + " scope global")
self.commands.append("/etc/init.d/networking stop")
self.commands.append("killall -9 udhcpc")
self.commands.append("rm /var/run/udhcpc*")
self.commands.append("/etc/init.d/networking start")
self.commands.append("/etc/init.d/avahi-daemon start")
self.restartConsole.eBatch(self.commands, self.restartNetworkFinished, callback, debug=True)
def restartNetworkFinished(self,extra_args):
( callback ) = extra_args
if callback is not None:
callback(True)
Alles anzeigen