]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)
authorHarald Hoyer <harald@redhat.com>
Tue, 24 Apr 2012 11:08:57 +0000 (13:08 +0200)
committerHarald Hoyer <harald@redhat.com>
Tue, 24 Apr 2012 11:08:57 +0000 (13:08 +0200)
If you're using a static network config, you'll want to keep your
nameservers around when NM starts. Write DNS1 (and DNS2, DNS3, etc..)
into the ifcfg file.

Thanks to Mark Hamzy <hamzy@us.ibm.com>
and Will Woods <wwoods@redhat.com> for the patch.

modules.d/45ifcfg/write-ifcfg.sh

index c072a138ce92550184833996bd440a291bda4355..b81ac3952889fd128070c727f5fddde6895dd4e7 100755 (executable)
@@ -138,6 +138,11 @@ for netif in $IFACES ; do
             } >> /tmp/ifcfg/ifcfg-$ethname
         fi
     fi
+    i=1
+    for ns in $(getargs nameserver); do
+        echo "DNS${i}=${ns}" >> /tmp/ifcfg/ifcfg-$netif
+        i=$((i+1))
+    done
 done
 
 # Pass network opts