summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/files
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2018-03-18 22:55:14 +0100
committerSuren A. Chilingaryan <csa@suren.me>2018-03-18 22:55:14 +0100
commit974da273128f43a564967716a7386b59f8832541 (patch)
treeacbfbce6d8d58d9da3ae75654dd8e4a401aebf9f /roles/openshift_node/files
parent22d3a96deaf74b7aa9aa021a73ef39e2b4da3378 (diff)
downloadopenshift-974da273128f43a564967716a7386b59f8832541.tar.gz
openshift-974da273128f43a564967716a7386b59f8832541.tar.bz2
openshift-974da273128f43a564967716a7386b59f8832541.tar.xz
openshift-974da273128f43a564967716a7386b59f8832541.zip
99-origin-dns.sh: Only modify resolv.conf if upstream DNS is already configured
Diffstat (limited to 'roles/openshift_node/files')
-rwxr-xr-xroles/openshift_node/files/networkmanager/99-origin-dns.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/roles/openshift_node/files/networkmanager/99-origin-dns.sh b/roles/openshift_node/files/networkmanager/99-origin-dns.sh
index 16129a288..8c597a65b 100755
--- a/roles/openshift_node/files/networkmanager/99-origin-dns.sh
+++ b/roles/openshift_node/files/networkmanager/99-origin-dns.sh
@@ -60,7 +60,8 @@ if [[ $2 =~ ^(up|dhcp4-change|dhcp6-change)$ ]]; then
def_routes_int=$(for r in ${def_routes}; do /sbin/ip route get to ${r} | awk '{print $3}'; done)
interfaces="${def_route_int} ${def_routes_int}"
- if [[ "${interfaces}" =~ (^|[[:space:]])${DEVICE_IFACE}($|[[:space:]]) ]]; then
+ nsconf=$(grep -P ^nameserver /etc/resolv.conf | wc -l)
+ if [[ $nsconf -gt 0 && "${interfaces}" =~ (^|[[:space:]])${DEVICE_IFACE}($|[[:space:]]) ]]; then
# if [[ ${DEVICE_IFACE} == ${def_route_int} ]]; then
if [ ! -f /etc/dnsmasq.d/origin-dns.conf ]; then
cat << EOF > /etc/dnsmasq.d/origin-dns.conf