From 4c4d702e0ffb1d25ec2b8ef19df44973b9f936c2 Mon Sep 17 00:00:00 2001 From: imdano <> Date: Sun, 8 Jul 2007 10:36:47 +0000 Subject: [PATCH] Added DNS fix to wired class --- networking.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/networking.py b/networking.py index 61ee199..58917d0 100644 --- a/networking.py +++ b/networking.py @@ -380,7 +380,7 @@ class Wireless: return misc.RunRegex(ip_pattern,output) #end function GetIP - def CreateAdHocNetwork(self,essid,channel,ip,enctype,key,encused): + def CreateAdHocNetwork(self,essid,channel,ip,enctype,key,encused,ics): misc.Run("killall dhclient dhclient3 wpa_supplicant") #remove wpa_supplicant, as it can cause the connection to revert to #previous networks... misc.Run('ifconfig ' + self.wireless_interface + ' down') @@ -541,13 +541,15 @@ class Wired: self.lock.acquire() self.ConnectingMessage = 'setting_static_dns' self.lock.release() - print "setting the first and second dns servers...", network["dns2"], network["dns2"] + print "setting the first dns server...", network["dns1"] resolv = open("/etc/resolv.conf","w") misc.WriteLine(resolv,"nameserver " + network["dns1"]) - misc.WriteLine(resolv,"nameserver " + network["dns2"]) + if not network.get("dns2") == None: + print "setting the second dns server...", network["dns2"] + misc.WriteLine(resolv,"nameserver " + network["dns2"]) if not network.get("dns3") == None: print "setting the third dns server..." - misc.WriteLine(resolv,"nameserver " + network["dns3"]) + misc.WriteLine(resolv,"nameserver " + network["dns3"])) if not network.get("ip") == None: self.lock.acquire()