From 17e4d31f3f50abb51fa35bcfdfd04cfc73469d36 Mon Sep 17 00:00:00 2001 From: Stefan Pluecken Date: Tue, 27 Dec 2005 03:57:04 +0000 Subject: [PATCH 1/1] fix more very stupid bugs... someone must have had too much drinks while writing this code --- lib/python/Components/Network.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/python/Components/Network.py b/lib/python/Components/Network.py index 8375d235..365e15f0 100644 --- a/lib/python/Components/Network.py +++ b/lib/python/Components/Network.py @@ -21,6 +21,12 @@ class Network: fp.write(" gateway %d.%d.%d.%d\n" % tuple(config.network.gateway.value)) fp.close() + if config.network.dhcp.value == 0: + fp = file('/etc/resolv.conf', 'w') + fp.write("nameserver %d.%d.%d.%d\n" % tuple(config.network.dns.value)) + fp.close() + + def loadNetworkConfig(self): try: # parse the interfaces-file @@ -48,7 +54,7 @@ class Network: ifaces[currif]["gateway"] = map(int, split[1].split('.')) # parse the resolv.conf-file - fp = file('/etc/network/interfaces', 'r') + fp = file('/etc/resolv.conf', 'r') resolv = fp.readlines() fp.close() except: -- 2.30.2