* [PATCH] ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)
@ 2012-04-23 20:25 Will Woods
[not found] ` <1335212725-20178-1-git-send-email-wwoods-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Will Woods @ 2012-04-23 20:25 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA
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
--
1.7.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)
[not found] ` <1335212725-20178-1-git-send-email-wwoods-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-04-24 10:45 ` Harald Hoyer
[not found] ` <4F968443.8020403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Harald Hoyer @ 2012-04-24 10:45 UTC (permalink / raw)
To: Will Woods; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)
[not found] ` <4F968443.8020403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2012-04-24 16:23 ` Will Woods
2012-04-24 16:24 ` Will Woods
1 sibling, 0 replies; 4+ messages in thread
From: Will Woods @ 2012-04-24 16:23 UTC (permalink / raw)
To: Harald Hoyer; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On Tue, 2012-04-24 at 12:45 +0200, Harald Hoyer wrote:
> 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
The code is actually equivalent, although I find this version confusing
since it comes after all the other special cases (I thought it was part
of the 'if [ -n "$bridge" ]' block at first!)
I'm sending an amended patch that puts it right next to all the other
unconditional stuff near the top of the loop - I think that's clearest.
-w
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)
[not found] ` <4F968443.8020403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-24 16:23 ` Will Woods
@ 2012-04-24 16:24 ` Will Woods
1 sibling, 0 replies; 4+ messages in thread
From: Will Woods @ 2012-04-24 16:24 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA
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 | 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-24 16:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
[not found] ` <4F968443.8020403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-04-24 16:23 ` Will Woods
2012-04-24 16:24 ` Will Woods
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.