[PATCH] ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> for the patch.
---
 modules.d/45ifcfg/write-ifcfg.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index c072a13..4b7bd3b 100755
--- a/modules.d/45ifcfg/write-ifcfg.sh
+++ b/modules.d/45ifcfg/write-ifcfg.sh
@@ -40,6 +40,11 @@ for netif in $IFACES ; do
         echo "UUID=$uuid"
         [ -n "$macaddr" ] && echo "MACADDR=$macaddr"
         [ -n "$mtu" ] && echo "MTU=$mtu"
+        i=1
+        for ns in $(getargs nameserver); do
+            echo DNS$i=$ns
+            i=$((i+1))
+        done
         if [ -f /tmp/net.$netif.lease ]; then
             strstr "$ip" '*:*:*' &&
             echo "DHCPV6C=yes"
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux