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

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

 



Am 23.04.2012 22:25, schrieb Will Woods:
> 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 |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
> index c072a13..3e1d89b 100755
> --- a/modules.d/45ifcfg/write-ifcfg.sh
> +++ b/modules.d/45ifcfg/write-ifcfg.sh
> @@ -53,6 +53,14 @@ for netif in $IFACES ; do
>              echo "NETMASK=$mask"
>              [ -n "$gw" ] && echo "GATEWAY=$gw"
>          fi
> +        namesrv=$(getargs nameserver)
> +        if [ -n "$namesrv" ]; then
> +            i=1
> +            for n in $namesrv; do
> +                echo DNS$i=$n
> +                i=$(($i+1))
> +            done
> +        fi
>      } > /tmp/ifcfg/ifcfg-$netif
>  
>      # bridge needs different things written to ifcfg

Hmm, I have this in my queue (different location):

diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh
index c072a13..b81ac39 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
--
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