summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-06-30 15:13:36 -0400
committerGitHub <noreply@github.com>2016-06-30 15:13:36 -0400
commit07e31ae677597a4b48892053614416dc7367cd11 (patch)
treed439c44de576afacaab7e88272b8cd3cc11e54a3
parent49b286608a060cdc5fca45008d01ac3c535ce314 (diff)
parenta069be8c5c54ff1661baa992d3f0e89afd6c92b6 (diff)
downloadopenshift-07e31ae677597a4b48892053614416dc7367cd11.tar.gz
openshift-07e31ae677597a4b48892053614416dc7367cd11.tar.bz2
openshift-07e31ae677597a4b48892053614416dc7367cd11.tar.xz
openshift-07e31ae677597a4b48892053614416dc7367cd11.zip
Merge pull request #2028 from IshentRas/fix_dns
Improve 99-origin-dns.sh
-rwxr-xr-xroles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
index 51a43d113..5a187710b 100755
--- a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
+++ b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
@@ -47,11 +47,14 @@ EOF
# zero out our upstream servers list and feed it into dnsmasq
echo -n > /etc/dnsmasq.d/origin-upstream-dns.conf
for ns in ${IP4_NAMESERVERS}; do
- echo "server=${ns}" >> /etc/dnsmasq.d/origin-upstream-dns.conf
+ if [[ ! -z $ns ]]; then
+ echo "server=${ns}" >> /etc/dnsmasq.d/origin-upstream-dns.conf
+ fi
done
systemctl restart dnsmasq
- sed -i 's/^nameserver.*$/nameserver '"${def_route_ip}"'/g' /etc/resolv.conf
+ sed -i '0,/^nameserver/ s/^nameserver.*$/nameserver '"${def_route_ip}"'/g' /etc/resolv.conf
+
if ! grep -q '99-origin-dns.sh' /etc/resolv.conf; then
echo "# nameserver updated by /etc/NetworkManager/dispatcher.d/99-origin-dns.sh" >> /etc/resolv.conf
fi