From da08727f3bbcc419096b160968aee83104bb7cf6 Mon Sep 17 00:00:00 2001 From: Lukas Nykryn Date: Fri, 16 Jan 2015 14:44:30 +0100 Subject: ifup-post: check resolve.conf also with DNS2 --- sysconfig/network-scripts/ifup-post | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sysconfig/network-scripts/ifup-post b/sysconfig/network-scripts/ifup-post index 2e93e008..46f49e3a 100755 --- a/sysconfig/network-scripts/ifup-post +++ b/sysconfig/network-scripts/ifup-post @@ -26,7 +26,14 @@ fi if [ "$PEERDNS" != "no" ] ||[ -n "$RESOLV_MODS" -a "$RESOLV_MODS" != "no" ]; then [ -n "$MS_DNS1" ] && DNS1=$MS_DNS1 [ -n "$MS_DNS2" ] && DNS2=$MS_DNS2 - if [ -n "$DNS1" ] && ! grep -q "^nameserver $DNS1" /etc/resolv.conf && + + if [ -z "$DNS1" -a -n "$DNS2" ]; then + DNS1=$DNS2 + DNS2= + fi + + if ( [ -n "$DNS1" ] && ! grep -q "^nameserver $DNS1" /etc/resolv.conf ) || + ( [ -n "$DNS2" ] && ! grep -q "^nameserver $DNS2" /etc/resolv.conf ) && tr=$(mktemp /tmp/XXXXXX) ; then current_replacement="$DNS1" next_replacement="$DNS2" -- cgit v1.2.1