X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/6eeefece35e4269e02fdb7abab4f79d8e7b8f98b..92456d9542585d58e011fa4f0b501de3ef9c1819:/lib/python/Components/Network.py diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 7513901f..5add0c01 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -80,9 +80,16 @@ class Network: except: print "[Network.py] parsing network failed" + def deactivateNetworkConfig(self): + import os + os.system("ip addr flush eth0") + os.system("/etc/init.d/networking stop") + os.system("killall -9 udhcpc") + os.system("rm /var/run/udhcpc*") + def activateNetworkConfig(self): import os - os.system("/etc/init.d/networking restart") + os.system("/etc/init.d/networking start") config.network.ip.value = self.getCurrentIP() config.network.ip.save() @@ -139,11 +146,9 @@ class Network: iNetwork = Network() def InitNetwork(): - ip = iNetwork.getCurrentIP() - config.network = ConfigSubsection() config.network.dhcp = NoSave(ConfigYesNo(default=True)) - config.network.ip = NoSave(ConfigIP(default=[0,0,0,0])) + config.network.ip = NoSave(ConfigIP(default=iNetwork.getCurrentIP())) config.network.netmask = NoSave(ConfigIP(default=[255,255,255,0])) config.network.gateway = NoSave(ConfigIP(default=[192,168,1,3])) config.network.dns = NoSave(ConfigIP(default=[192,168,1,3]))