From 974da273128f43a564967716a7386b59f8832541 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Sun, 18 Mar 2018 22:55:14 +0100 Subject: 99-origin-dns.sh: Only modify resolv.conf if upstream DNS is already configured --- roles/openshift_node/files/networkmanager/99-origin-dns.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'roles/openshift_node') 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 -- cgit v1.2.3