workaround for not working /etc/init.d/network script
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 18 Oct 2006 00:12:07 +0000 (00:12 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 18 Oct 2006 00:12:07 +0000 (00:12 +0000)
lib/python/Components/Network.py
lib/python/Screens/NetworkSetup.py

index 0493f0faccef25f6b3c8f7441f3c4e9d670945ac..5add0c01913aa0560a268514c68fa1f9bf129d17 100644 (file)
@@ -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()
                
index 9ffae8462e2b57048a653e5e8f2a7f0f3a49bfea..278c66063055d3334ab3849c3d1b50c1c935af92 100644 (file)
@@ -51,6 +51,8 @@ class NetworkSetup(Screen, ConfigListScreen):
        def ok(self):
                #for x in self["config"].list:
                        #x[1].save()
+               
+               iNetwork.deactivateNetworkConfig()
                iNetwork.writeNetworkConfig()    
                iNetwork.activateNetworkConfig()
                self.close()