diff options
author | Kenjiro Nakayama <nakayamakenjiro@gmail.com> | 2017-09-29 18:17:29 +0900 |
---|---|---|
committer | Kenjiro Nakayama <nakayamakenjiro@gmail.com> | 2017-09-29 18:17:29 +0900 |
commit | 7f20af939e13a7cec3cf56cedd7aa8a302ee58db (patch) | |
tree | d52e166c8b027ef3c02e6dc07ac6255c535de7e4 | |
parent | bf61775799fc7fb0fccf63ef11102bf48d5a2d7a (diff) | |
download | openshift-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
-rwxr-xr-x | roles/openshift_node_dnsmasq/files/networkmanager/99-origin-dns.sh | 6 |
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 |