Blame 0032-ifcfg-write-DNS1-.-for-nameserver-args-RHBZ-815369.patch

Harald Hoyer 2f4f1d
From eb6e141adb9ee06de1f0a960602526f0aa314817 Mon Sep 17 00:00:00 2001
Harald Hoyer 2f4f1d
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 2f4f1d
Date: Tue, 24 Apr 2012 13:08:57 +0200
Harald Hoyer 2f4f1d
Subject: [PATCH] ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
If you're using a static network config, you'll want to keep your
Harald Hoyer 2f4f1d
nameservers around when NM starts. Write DNS1 (and DNS2, DNS3, etc..)
Harald Hoyer 2f4f1d
into the ifcfg file.
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
Thanks to Mark Hamzy <hamzy@us.ibm.com>
Harald Hoyer 2f4f1d
and Will Woods <wwoods@redhat.com> for the patch.
Harald Hoyer 2f4f1d
---
Harald Hoyer 2f4f1d
 modules.d/45ifcfg/write-ifcfg.sh |    5 +++++
Harald Hoyer 2f4f1d
 1 file changed, 5 insertions(+)
Harald Hoyer 2f4f1d
Harald Hoyer 2f4f1d
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
Harald Hoyer 2f4f1d
index c072a13..b81ac39 100755
Harald Hoyer 2f4f1d
--- a/modules.d/45ifcfg/write-ifcfg.sh
Harald Hoyer 2f4f1d
+++ b/modules.d/45ifcfg/write-ifcfg.sh
Harald Hoyer 2f4f1d
@@ -138,6 +138,11 @@ for netif in $IFACES ; do
Harald Hoyer 2f4f1d
             } >> /tmp/ifcfg/ifcfg-$ethname
Harald Hoyer 2f4f1d
         fi
Harald Hoyer 2f4f1d
     fi
Harald Hoyer 2f4f1d
+    i=1
Harald Hoyer 2f4f1d
+    for ns in $(getargs nameserver); do
Harald Hoyer 2f4f1d
+        echo "DNS${i}=${ns}" >> /tmp/ifcfg/ifcfg-$netif
Harald Hoyer 2f4f1d
+        i=$((i+1))
Harald Hoyer 2f4f1d
+    done
Harald Hoyer 2f4f1d
 done
Harald Hoyer 2f4f1d
 
Harald Hoyer 2f4f1d
 # Pass network opts