summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorKenjiro Nakayama <nakayamakenjiro@gmail.com>2017-09-29 18:17:29 +0900
committerKenjiro Nakayama <nakayamakenjiro@gmail.com>2017-09-29 18:17:29 +0900
commit7f20af939e13a7cec3cf56cedd7aa8a302ee58db (patch)
treed52e166c8b027ef3c02e6dc07ac6255c535de7e4 /roles
parentbf61775799fc7fb0fccf63ef11102bf48d5a2d7a (diff)
downloadopenshift-7f20af939e13a7cec3cf56cedd7aa8a302ee58db.tar.gz
openshift-7f20af939e13a7cec3cf56cedd7aa8a302ee58db.tar.bz2
openshift-7f20af939e13a7cec3cf56cedd7aa8a302ee58db.tar.xz
openshift-7f20af939e13a7cec3cf56cedd7aa8a302ee58db.zip
Add valid search when search does not exist on resolv.conf
Diffstat (limited to 'roles')
-rwxr-xr-xroles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh6
1 files changed, 3 insertions, 3 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 df02bcf0e..230f0a28c 100755
--- a/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
+++ b/roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh
@@ -112,10 +112,10 @@ EOF
fi
sed -e '/^nameserver.*$/d' /etc/resolv.conf >> ${NEW_RESOLV_CONF}
echo "nameserver "${def_route_ip}"" >> ${NEW_RESOLV_CONF}
- if ! grep -q 'search.*cluster.local' ${NEW_RESOLV_CONF}; then
- sed -i '/^search/ s/$/ cluster.local/' ${NEW_RESOLV_CONF}
- elif ! grep -qw search ${NEW_RESOLV_CONF}; then
+ if ! grep -qw search ${NEW_RESOLV_CONF}; then
echo 'search cluster.local' >> ${NEW_RESOLV_CONF}
+ elif ! grep -q 'search.*cluster.local' ${NEW_RESOLV_CONF}; then
+ sed -i '/^search/ s/$/ cluster.local/' ${NEW_RESOLV_CONF}
fi
cp -Z ${NEW_RESOLV_CONF} /etc/resolv.conf
fi