From: Harald Hoyer Date: Tue, 24 Apr 2012 11:08:57 +0000 (+0200) Subject: ifcfg: write DNS1=... for nameserver= args (RHBZ#815369) X-Git-Tag: 019~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb6e141adb9ee06de1f0a960602526f0aa314817;p=thirdparty%2Fdracut.git ifcfg: write DNS1=... for nameserver= args (RHBZ#815369) 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 and Will Woods for the patch. --- diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh index c072a138c..b81ac3952 100755 --- a/modules.d/45ifcfg/write-ifcfg.sh +++ b/modules.d/45ifcfg/write-ifcfg.sh @@ -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