From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Will Woods <wwoods-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)
Date: Tue, 24 Apr 2012 12:45:23 +0200 [thread overview]
Message-ID: <4F968443.8020403@redhat.com> (raw)
In-Reply-To: <1335212725-20178-1-git-send-email-wwoods-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
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-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> 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
next prev parent reply other threads:[~2012-04-24 10:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 20:25 [PATCH] ifcfg: write DNS1=... for nameserver= args (RHBZ#815369) Will Woods
[not found] ` <1335212725-20178-1-git-send-email-wwoods-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-24 10:45 ` Harald Hoyer [this message]
[not found] ` <4F968443.8020403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-24 16:23 ` Will Woods
2012-04-24 16:24 ` Will Woods
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F968443.8020403@redhat.com \
--to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wwoods-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.